﻿  function checkValidateSearch(){
   if(trim(document.getElementById('TopBar_Search_txtUserId').value)=="")
  {
  alert("Search is Empty")
  document.getElementById('TopBar_Search_txtUserId').focus();
   return false; 
  }
 }
 
 
 
 function checkValidateSearchHome(){
 if(Trim(document.getElementById('TopBar_txtUserId').value)=="")
  {
  alert("Search is Empty")
  document.getElementById('TopBar_txtUserId').focus();
  return false; 
  }
 }
 
function SerachValidate()
{
    document.getElementById('TopBar_Search_txtUserId').value="";
}
function SerachValidateHome()
{
    document.getElementById('TopBar_txtUserId').value="";
}

function LTrim(str)
{
  var whitespace = new String(" \t\n\r");

  var s = new String(str);

  if (whitespace.indexOf(s.charAt(0)) != -1) {
    // We have a string with leading blank(s)...

    var j=0, i = s.length;

    // Iterate from the far left of string until we
    // don't have any more whitespace...
    while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
    j++;


    // Get the substring from the first non-whitespace
    // character to the end of the string...
    s = s.substring(j, i);
  }

  return s;
}

// --------------------------------------------------------------------------
// Remove trailing blanks from our string.

// I               str - the string we want to RTrim
// Return          the input string without any trailing whitespace

// Date            03 avr. 2003 23:13:50
// Author          Aurélien Tisné	(CS)
// --------------------------------------------------------------------------
function RTrim(str)
{
  // We don't want to trip JUST spaces, but also tabs,
  // line feeds, etc.  Add anything else you want to
  // "trim" here in Whitespace
  var whitespace = new String(" \t\n\r");

  var s = new String(str);

  if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
    // We have a string with trailing blank(s)...

    var i = s.length - 1;       // Get length of string

    // Iterate from the far right of string until we
    // don't have any more whitespace...
    while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
      i--;


    // Get the substring from the front of the string to
    // where the last non-whitespace character is...
    s = s.substring(0, i+1);
  }

  return s;
}


// --------------------------------------------------------------------------
// Remove trailing and leading blanks from our string.

// I               str - the string we want to Trim
// Return          the trimmed input string

// Date            03 avr. 2003 23:15:09
// Author          Aurélien Tisné	(CS)
// --------------------------------------------------------------------------
function Trim(str)
{
  return RTrim(LTrim(str));
}

/*function FirstTab(){
document.getElementById('FirstButton').style.backgroundColor='#656565';
document.getElementById('SecondButton').style.backgroundColor='white';
document.getElementById('ThirdButton').style.backgroundColor='white';
document.getElementById('ForthButton').style.backgroundColor='white';
 document.getElementById('FirstDescription').style.display="block";
 document.getElementById('SecondDescription').style.display="none";
 document.getElementById('ThirdDescription').style.display="none";
 document.getElementById('ForthDescription').style.display="none";
}



function SecondTab()
{
 document.getElementById('FirstButton').style.backgroundColor='white';
document.getElementById('SecondButton').style.backgroundColor='#656565';
document.getElementById('ThirdButton').style.backgroundColor='white';
document.getElementById('ForthButton').style.backgroundColor='white';
 document.getElementById('FirstDescription').style.display="none";
 document.getElementById('SecondDescription').style.display="block";
 document.getElementById('ThirdDescription').style.display="none";
 document.getElementById('ForthDescription').style.display="none";
}

function ThirdTab()
{
 document.getElementById('FirstButton').style.backgroundColor='white';
document.getElementById('SecondButton').style.backgroundColor='white';
document.getElementById('ThirdButton').style.backgroundColor='#656565';
document.getElementById('ForthButton').style.backgroundColor='white';
 document.getElementById('FirstDescription').style.display="none";
 document.getElementById('SecondDescription').style.display="none";
 document.getElementById('ThirdDescription').style.display="block";
 document.getElementById('ForthDescription').style.display="none";
}

function ForthTab()
{
 document.getElementById('FirstButton').style.backgroundColor='white';
document.getElementById('SecondButton').style.backgroundColor='white';
document.getElementById('ThirdButton').style.backgroundColor='white';
document.getElementById('ForthButton').style.backgroundColor='#656565';
 document.getElementById('FirstDescription').style.display="none";
 document.getElementById('SecondDescription').style.display="none";
 document.getElementById('ThirdDescription').style.display="none";
 document.getElementById('ForthDescription').style.display="block";
}
*/
    
function FirstTab()
{


document.getElementById("RightTable_FirstButton"). style. backgroundImage = "url(/QAI/Images/second.jpg)";
document.getElementById("RightTable_SecondButton"). style. backgroundImage = "url(/QAI/Images/first.jpg)";
document.getElementById("RightTable_ThirdButton"). style. backgroundImage = "url(/QAI/Images/first.jpg)";
document.getElementById("RightTable_ForthButton"). style. backgroundImage = "url(/QAI/Images/first.jpg)";

document.getElementById("RightTable_FirstButton"). style.color="white";
document.getElementById("RightTable_SecondButton"). style.color="#626060";
document.getElementById("RightTable_ThirdButton"). style.color="#626060";
document.getElementById("RightTable_ForthButton"). style.color="#626060";

 document.getElementById('FirstDescription').style.display="block";
 document.getElementById('SecondDescription').style.display="none";
 document.getElementById('ThirdDescription').style.display="none";
 document.getElementById('ForthDescription').style.display="none";

}
function SecondTab()
{

document.getElementById("RightTable_FirstButton"). style. backgroundImage = "url(/QAI/Images/first.jpg)";
document.getElementById("RightTable_SecondButton"). style. backgroundImage = "url(/QAI/Images/second.jpg)";
document.getElementById("RightTable_ThirdButton"). style. backgroundImage = "url(/QAI/Images/first.jpg)";
document.getElementById("RightTable_ForthButton"). style. backgroundImage = "url(/QAI/Images/first.jpg)";

document.getElementById("RightTable_FirstButton"). style.color="#626060";
document.getElementById("RightTable_SecondButton"). style.color="white";
document.getElementById("RightTable_ThirdButton"). style.color="#626060";
document.getElementById("RightTable_ForthButton"). style.color="#626060";

 document.getElementById('FirstDescription').style.display="none";
 document.getElementById('SecondDescription').style.display="block";
 document.getElementById('ThirdDescription').style.display="none";
 document.getElementById('ForthDescription').style.display="none";


}

function ThirdTab()
{
document.getElementById("RightTable_FirstButton"). style. backgroundImage = "url(/QAI/Images/first.jpg)";
document.getElementById("RightTable_SecondButton"). style. backgroundImage = "url(/QAI/Images/first.jpg)";
document.getElementById("RightTable_ThirdButton"). style. backgroundImage = "url(/QAI/Images/second.jpg)";
document.getElementById("RightTable_ForthButton"). style. backgroundImage = "url(/QAI/Images/first.jpg)";

document.getElementById("RightTable_FirstButton"). style.color="#626060";
document.getElementById("RightTable_SecondButton"). style.color="#626060";
document.getElementById("RightTable_ThirdButton"). style.color="White";
document.getElementById("RightTable_ForthButton"). style.color="#626060";
 document.getElementById('FirstDescription').style.display="none";
 document.getElementById('SecondDescription').style.display="none";
 document.getElementById('ThirdDescription').style.display="block";
 document.getElementById('ForthDescription').style.display="none";

}

function ForthTab()
{

document.getElementById("RightTable_FirstButton"). style. backgroundImage = "url(/QAI/Images/first.jpg)";
document.getElementById("RightTable_SecondButton"). style. backgroundImage = "url(/QAI/Images/first.jpg)";
document.getElementById("RightTable_ThirdButton"). style. backgroundImage = "url(/QAI/Images/first.jpg)";
document.getElementById("RightTable_ForthButton"). style. backgroundImage = "url(/QAI/Images/second.jpg)";
document.getElementById("RightTable_FirstButton"). style.color="#626060";
document.getElementById("RightTable_SecondButton"). style.color="#626060";
document.getElementById("RightTable_ThirdButton"). style.color="#626060";
document.getElementById("RightTable_ForthButton"). style.color="White";

 document.getElementById('FirstDescription').style.display="none";
 document.getElementById('SecondDescription').style.display="none";
 document.getElementById('ThirdDescription').style.display="none";
 document.getElementById('ForthDescription').style.display="block";

}


function openNewsletter(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/QAI/GlobalService/Newsletter.aspx', 'Newsletter', 'width=500px,height=200px,center=1,resize=0,scrolling=1')

emailwindow.onclose=function(){ //Define custom code to run when window is closed
	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		alert("Please enter a valid email address")
		return false //cancel closing of modal window
	}
	else{ //else if this is a valid email
		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		return true //allow closing of window
	}
}
} //End "opennewsletter" function

//Start "Alliance with us" function
function openAlliancesWith(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/QAI/GlobalService/AlliancesWith_Us.aspx', 'Alliance with Us', 'width=500px,height=400px,center=1,resize=0,scrolling=1')

emailwindow.onclose=function(){ //Define custom code to run when window is closed
	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		alert("Please enter a valid email address")
		return false //cancel closing of modal window
	}
	else{ //else if this is a valid email
		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		return true //allow closing of window
	}
}
} //End "Alliance with Us" function

   
//Start "GAP" function
function opennewsletter1(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/QAI/GlobalService/GAP.aspx', 'GAP Analysis', 'width=500px,height=400px,center=1,resize=0,scrolling=1')

emailwindow.onclose=function(){ //Define custom code to run when window is closed
	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		alert("Please enter a valid email address")
		return false //cancel closing of modal window
	}
	else{ //else if this is a valid email
		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		return true //allow closing of window
	}
}
} //End "GAP" function

//Start "Feedback" function
function openFeedback(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/QAI/GlobalService/sender_feedback.aspx', 'FeedBack', 'width=500px,height=500px,center=1,resize=0,scrolling=1')

emailwindow.onclose=function(){ //Define custom code to run when window is closed
	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		alert("Please enter a valid email address")
		return false //cancel closing of modal window
	}
	else{ //else if this is a valid email
		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		return true //allow closing of window
	}
}
} //End "Feedback" function

//Start "Request for services" function
function openRequest(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/QAI/GlobalService/req_for_services.aspx', 'REQUEST FOR SERVICES', 'width=500px,height=400px,center=1,resize=0,scrolling=1')

emailwindow.onclose=function(){ //Define custom code to run when window is closed
	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		alert("Please enter a valid email address")
		return false //cancel closing of modal window
	}
	else{ //else if this is a valid email
		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		return true //allow closing of window
	}
}
} //End "request" function

//start "Joinus" function

function openJoinus(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/QAI/GlobalService/GlobalJoinUs.aspx', 'JOIN US', 'width=500px,height=400px,center=1,resize=0,scrolling=1')

emailwindow.onclose=function(){ //Define custom code to run when window is closed
	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		alert("Please enter a valid email address")
		return false //cancel closing of modal window
	}
	else{ //else if this is a valid email
		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		return true //allow closing of window
	}
}
} //End "Joinus" function

//start "Applynow" function

function openJoinus(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/QAI/GlobalService/GlobalApplyNow.aspx', 'APPLY NOW', 'width=500px,height=400px,center=1,resize=0,scrolling=1')

emailwindow.onclose=function(){ //Define custom code to run when window is closed
	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		alert("Please enter a valid email address")
		return false //cancel closing of modal window
	}
	else{ //else if this is a valid email
		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		return true //allow closing of window
	}
}
} //End "PurchasePorduct" function

function openPurchase(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/QAI/GlobalService/GAP.aspx', 'PURCHASE PRODUCT', 'width=500px,height=400px,center=1,resize=0,scrolling=1')

emailwindow.onclose=function(){ //Define custom code to run when window is closed
	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		alert("Please enter a valid email address")
		return false //cancel closing of modal window
	}
	else{ //else if this is a valid email
		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		return true //allow closing of window
	}
}
} //End "PurchasePorduct" function
//start "registraction" function
function openRegistration(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/QAI/GlobalService/Registeration.aspx', 'REGISTRATION', 'width=500px,height=500px,center=1,resize=0,scrolling=1')

emailwindow.onclose=function(){ //Define custom code to run when window is closed
	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		alert("Please enter a valid email address")
		return false //cancel closing of modal window
	}
	else{ //else if this is a valid email
		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		return true //allow closing of window
	}
}
} //End "registraction" function

//start "downloadsample" function
function opendownload(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/QAI/GlobalService/Download_Sample.aspx', 'DOWNLOAD SAMPLE', 'width=500px,height=400px,center=1,resize=0,scrolling=1')

emailwindow.onclose=function(){ //Define custom code to run when window is closed
	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		alert("Please enter a valid email address")
		return false //cancel closing of modal window
	}
	else{ //else if this is a valid email
		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		return true //allow closing of window
	}
}
} //End "downloadsample" function

//start "CONSULTING" function
function openform(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/QAI/GlobalService/Consulting.aspx', 'CONSULTING FORM', 'width=500px,height=400px,center=1,resize=0,scrolling=1')

emailwindow.onclose=function(){ //Define custom code to run when window is closed
	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		alert("Please enter a valid email address")
		return false //cancel closing of modal window
	}
	else{ //else if this is a valid email
		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		return true //allow closing of window
	}
}
} //End "CONSULTING" function


function OpenLocation(){

	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/QAI/GlobalService/GlobalLocation.aspx', 'Location', 'width=500px,height=200px,center=1,resize=0,scrolling=1')

emailwindow.onclose=function(){ //Define custom code to run when window is closed
	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		alert("Please enter a valid email address")
		return false //cancel closing of modal window
	}
	else{ //else if this is a valid email
		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		return true //allow closing of window
	}
}
} //End "opennewsletter" function




function openpassword(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/QAI/GlobalService/GlobalPasswordSent.aspx', 'RESENT PASSWORD', 'width=550px,height=150px,center=1,resize=0,scrolling=1')

emailwindow.onclose=function(){ //Define custom code to run when window is closed
	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		alert("Please enter a valid email address")
		return false //cancel closing of modal window
	}
	else{ //else if this is a valid email
		document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		return true //allow closing of window
	}
}
} //End "resent


function openDownLoadPrompt(URL){
var window1=window.open(URL,'mywindow','width=600,heig ht=500,screenX=0,screenY=0,left=0,top=0,toolbar=ye s,location=yes,directories=yes,status=yes,menubar= yes,scrollbars=yes,copyhistory=yes,resizable=yes') ;

window1.document.execCommand("SaveAs","1","");

}








/////////////////////////////////////////////////Amit////////////////

