var homeMenuTimer;
var menuinterVal;
var tabNavTimer;
var sitemapTimer;
var spl3tTimer;
var tabNavCNum = -1;
var	selectedParent = "";
var selectedChild = "";
var smCol;
var allcell;
var spl3tID="";
var htmlloadflag = false;
var spacer09 = "";
var l4flag=false;
var formprintswitch="";
var c09CoLaDefOffsetTop;
var homeImageBannerTooltip ="";

function showSiteMap(sitemapCol,sitemapAllCell){
smCol=sitemapCol;
allcell=sitemapAllCell;
sitemapTimer = setTimeout("alignSitemap()",100);
}

function alignSitemap(){
try{
var sitemapColHeight=0;
var eCell = allcell.split("|");
var adjustHeight=0;
for(var i=0; i<smCol; i++){
try{
if(document.getElementById("smcol_"+adjustHeight).clientHeight<=document.getElementById("smcol_"+i).clientHeight){
adjustHeight=i;
sitemapColHeight = document.getElementById("smcol_"+i).clientHeight;
}
}catch(e){}
}
for(var i=0; i<smCol; i++){
try{
document.getElementById("smcol_"+i).style.height = (sitemapColHeight-1)+"px;";
}catch(e){}
}
document.getElementById(eCell[adjustHeight+1]).style.borderBottom="0px";
clearTimeout(sitemapTimer);
}catch(e){}
}

function alignTabNavigation(cNum,spacer,level4flag){
l4flag=level4flag;
spacer09 = spacer;
tabNavCNum = cNum;
//alert(document.getElementById("tabElem09_0").offsetLeft+"=="+document.getElementById("tabElem09_"+tabNavCNum).offsetLeft);
if(tabNavCNum>0){
try{
if(document.getElementById("tabElem09_0").offsetLeft!=document.getElementById("tabElem09_"+tabNavCNum).offsetLeft){
	document.getElementById("tabShadow_"+(tabNavCNum-1)).src=spacer09;
	document.getElementById("tabShadow_"+(tabNavCNum-1)).style.background="#627995";
	document.getElementById("tabShadow_"+(tabNavCNum-1)).style.width="11px";
	document.getElementById("tabShadow_"+(tabNavCNum-1)).style.height="22px";
	if(l4flag==true)document.getElementById("tabShadow_"+(tabNavCNum-1)).style.display="none";
}
}catch(e){}
tabNavTimer = setTimeout("alignTab()",100);
}
}

function alignTab(){
try{
if(document.getElementById("tabElem09_0").offsetLeft!=document.getElementById("tabElem09_"+tabNavCNum).offsetLeft){
	document.getElementById("tabShadow_"+(tabNavCNum-1)).src=spacer09;
	document.getElementById("tabShadow_"+(tabNavCNum-1)).style.background="#627995";
	document.getElementById("tabShadow_"+(tabNavCNum-1)).style.width="11px";
	document.getElementById("tabShadow_"+(tabNavCNum-1)).style.height="22px";
	if(l4flag==true)document.getElementById("tabShadow_"+(tabNavCNum-1)).style.display="none";
}
clearTimeout(tabNavTimer);
}catch(e){}
}

function showHomeMenu(){
homeMenuTimer = setTimeout("alignMenuWidth()",100);
}

function showHome5Menu(){
homeMenuTimer = setTimeout("align5MenuWidth()",100);
}

function alignSpl3t(splid){
spl3tID=splid;
spl3tTimer = setInterval("alignSpl3Height()",100);
}

function alignSpl3Height(){
if(htmlloadflag==true){
try{
var max3THeight=0; //536
for(var i=1;i<=3;i++){
var spl3ttmp = document.getElementById(spl3tID+i).offsetHeight;
max3THeight = (max3THeight<=spl3ttmp)?spl3ttmp:max3THeight;
}
max3THeight = (max3THeight==0)?540:max3THeight;
for(var i=1;i<=3;i++){
document.getElementById(spl3tID+i).style.height=max3THeight+"px";
}
clearInterval(spl3tTimer);
}catch(e){}
}
}

function alignMenuWidth(){
try{
var adoptedMenuWidth=0;

var adoptedMenuHeight=(document.getElementById("rowDivDown2").clientHeight>120)?document.getElementById("rowDivDown2").clientHeight:120;
for(var i=1;i<=4;i++)
{

var topCellWidth=document.getElementById("cellt"+i).clientWidth;
var bottomCellWidth=document.getElementById("dcellb"+i).clientWidth;


//alert("topCellWidth:"+topCellWidth);
//alert("bottomCellWidth:"+bottomCellWidth);

var actWidth=(topCellWidth>bottomCellWidth)?topCellWidth:bottomCellWidth;
actWidth = (actWidth>150)?actWidth:150;
adoptedMenuWidth = adoptedMenuWidth+actWidth;
document.getElementById("cellt"+i).style.width=actWidth+"px";
document.getElementById("mshadow"+i).style.width=actWidth+"px";
document.getElementById("mshadowc"+i).style.width=actWidth+"px";
document.getElementById("nomshadow"+i).style.width=actWidth+"px";
for(var j=1; j<=7; j++){
	try{ document.getElementById("cellb"+i+j).style.width=actWidth+"px"; } catch(e){}
}
try{ document.getElementById("cellb"+i).style.height=adoptedMenuHeight+"px"; } catch(e){}
try{ document.getElementById("bspac"+i).style.height=adoptedMenuHeight+"px"; } catch(e){}

}
if((804-(adoptedMenuWidth+3))>0){
document.getElementById("mshadowc5a").style.width=(804-(adoptedMenuWidth+3))+"px";
}

document.getElementById("rowDivTop").style.visibility="visible";
//document.getElementById("rowDivTop2").style.visibility="hidden";
document.getElementById("rowDivDown2").style.display="none";

clearTimeout(homeMenuTimer);
}catch(e){}
}

function align5MenuWidth(){
try{
var adoptedMenuWidth=0;

var adoptedMenuHeight=(document.getElementById("rowDivDown2").clientHeight>120)?document.getElementById("rowDivDown2").clientHeight:120;
for(var i=1;i<=5;i++)
{
var topCellWidth=document.getElementById("cellt"+i).clientWidth;
var bottomCellWidth=document.getElementById("dcellb"+i).clientWidth;
var actWidth=(topCellWidth>bottomCellWidth)?topCellWidth:bottomCellWidth;
actWidth = 160;//(actWidth>150)?actWidth:150;
adoptedMenuWidth = adoptedMenuWidth+actWidth;
document.getElementById("cellt"+i).style.width=actWidth+"px";
document.getElementById("mshadow"+i).style.width=actWidth+"px";
document.getElementById("mshadowc"+i).style.width=actWidth+"px";
document.getElementById("nomshadow"+i).style.width=actWidth+"px";
for(var j=1; j<=7; j++){
	try{ document.getElementById("cellb"+i+j).style.width=actWidth+"px"; } catch(e){}	
}
try{ document.getElementById("cellb"+i).style.height=adoptedMenuHeight+"px"; } catch(e){}
try{ document.getElementById("bspac"+i).style.height=adoptedMenuHeight+"px"; } catch(e){}
}
if((804-(adoptedMenuWidth+3))>0){
//document.getElementById("mshadowc5a").style.width=(804-(adoptedMenuWidth+3))+"px";
}
document.getElementById("rowDivTop").style.visibility="visible";
document.getElementById("rowDivDown2").style.display="none";
clearTimeout(homeMenuTimer);
}catch(e){}
}

	function hilightMenuAct(id)
	{

	if(document.getElementById(id).childNodes[0].innerHTML==null || document.getElementById(id).childNodes[0].innerHTML=="")
	{
	document.getElementById(id).style.backgroundColor='';
	}
	else
	{
	showsubmenu();
	

	//document.getElementById(id).style.backgroundColor='#BD7B01';
	}
	}
	
	function hilightMenu(id)
	{

	if(document.getElementById(id).childNodes[0].innerHTML==null || document.getElementById(id).childNodes[0].innerHTML=="")
	{
	document.getElementById(id).style.backgroundColor='';
	}
	else
	{
	showsubmenu();
	var topAnchorid = "anchorb"+id.substring(5,id.length);
	document.getElementById(topAnchorid).className="topNavLevelOver";
	//document.getElementById(id).style.backgroundColor='#BD7B01';
	}
	}
	
	function lowlightMenu(id)
	{	
	var topAnchorid = "anchorb"+id.substring(5,id.length);
	document.getElementById(topAnchorid).className="topNavLevel";
	}





	
	function showsubmenu()
	{
		
	document.getElementById("cellb1").style.visibility="visible";
		document.getElementById("cellb2").style.visibility="visible";
			document.getElementById("cellb3").style.visibility="visible";
				document.getElementById("cellb4").style.visibility="visible";
					try{document.getElementById("cellb5").style.visibility="visible";}catch(e){}
						try{document.getElementById("cellb6").style.visibility="visible";}catch(e){}
	}





	function hidesubmenu()
	{
			document.getElementById("cellb1").style.visibility="hidden";
			document.getElementById("cellb2").style.visibility="hidden";
			document.getElementById("cellb3").style.visibility="hidden";
			document.getElementById("cellb4").style.visibility="hidden";
			try{document.getElementById("cellb5").style.visibility="hidden";}catch(e){}
			try{document.getElementById("cellb6").style.visibility="hidden";}catch(e){}
	}


	function enableSubMenuAct(id,eFlag)
	{

	//alert(id.substring((id.length-1),(id.length)));
	
	

	

	document.getElementById("nomshadow1").style.display="none";
		
	document.getElementById("mshadow1").style.display="";
	document.getElementById("mshadow2").style.display="";
	document.getElementById("nomshadow2").style.display="none";
	document.getElementById("mshadow3").style.display="";
	document.getElementById("nomshadow3").style.display="none";
	document.getElementById("mshadow4").style.display="";
	document.getElementById("nomshadow4").style.display="none";
	try{document.getElementById("mshadow5").style.display="";}catch(e){}
	try{document.getElementById("nomshadow5").style.display="none";}catch(e){}
		
	var topMenuid = "cellt"+id.charAt(5);
	var topAnchorid = "anchort"+id.charAt(5);
	var subMenuid ="cellb"+id.charAt(5);
	var shadow = "mshadowc"+id.charAt(5);
	var shadow_rem = "mshadow"+id.charAt(5);
	document.getElementById(shadow).style.display="";
	document.getElementById(shadow_rem).style.display="none";
	try{document.getElementById("mshadowc5a").style.display="";}catch(e){}
	

	if(document.getElementById(topMenuid).childNodes[0].innerHTML != null && document.getElementById(topMenuid).childNodes[0].innerHTML !="" )
	{
	

	showsubmenu();

		
	
		
			if(eFlag)document.getElementById(subMenuid).style.backgroundColor='#E4EBF6';
		
				document.getElementById("rowDivDown").style.visibility="visible";
			
		if(eFlag)document.getElementById(topMenuid).style.backgroundColor='#647996';
		if(eFlag)document.getElementById(topAnchorid).className="topNavLevelAct";

	try{document.getElementById("tspac1").style.backgroundColor="#6B7E8F";}catch(e){}
	try{document.getElementById("tspac2").style.backgroundColor="#6B7E8F";}catch(e){}
	try{document.getElementById("tspac3").style.backgroundColor="#6B7E8F";}catch(e){}
	try{document.getElementById("tspac4").style.backgroundColor="#6B7E8F";}catch(e){}
	try{document.getElementById("bspac1").style.backgroundColor="#6B7E8F";}catch(e){}
	try{document.getElementById("bspac2").style.backgroundColor="#6B7E8F";}catch(e){}
	try{document.getElementById("bspac3").style.backgroundColor="#6B7E8F";}catch(e){}
	try{document.getElementById("bspac4").style.backgroundColor="#6B7E8F";}catch(e){}

}



	}

	
	
	function enableSubMenu(id,eFlag)
	{

	//alert(id.substring((id.length-1),(id.length)));
	
	

	

	document.getElementById("nomshadow1").style.display="none";
		
	document.getElementById("mshadow1").style.display="";
	document.getElementById("mshadow2").style.display="";
	document.getElementById("nomshadow2").style.display="none";
		document.getElementById("mshadow3").style.display="";
	document.getElementById("nomshadow3").style.display="none";
		document.getElementById("mshadow4").style.display="";
	document.getElementById("nomshadow4").style.display="none";
	try{document.getElementById("mshadow5").style.display="";}catch(e){}
	try{document.getElementById("nomshadow5").style.display="none";}catch(e){}
		
	var topMenuid = "cellt"+id.charAt(5);
	var topAnchorid = "anchort"+id.charAt(5);
	var subMenuid ="cellb"+id.charAt(5);
	var shadow = "mshadowc"+id.charAt(5);
	var shadow_rem = "mshadow"+id.charAt(5);
	document.getElementById(shadow).style.display="";
	document.getElementById(shadow_rem).style.display="none";
	try{document.getElementById("mshadowc5a").style.display="";}catch(e){}
	

	if(document.getElementById(topMenuid).childNodes[0].innerHTML != null && document.getElementById(topMenuid).childNodes[0].innerHTML !="" )
	{
	

	showsubmenu();

		
	
		
			if(eFlag)document.getElementById(subMenuid).style.backgroundColor='#E4EBF6';
		
				document.getElementById("rowDivDown").style.visibility="visible";
			
		if(eFlag)document.getElementById(topMenuid).style.backgroundColor='#E4EBF6';
		if(eFlag)document.getElementById(topAnchorid).className="topNavLevelOver";

	try{document.getElementById("tspac1").style.backgroundColor="#6B7E8F";}catch(e){}
	try{document.getElementById("tspac2").style.backgroundColor="#6B7E8F";}catch(e){}
	try{document.getElementById("tspac3").style.backgroundColor="#6B7E8F";}catch(e){}
	try{document.getElementById("tspac4").style.backgroundColor="#6B7E8F";}catch(e){}
	try{document.getElementById("bspac1").style.backgroundColor="#6B7E8F";}catch(e){}
	try{document.getElementById("bspac2").style.backgroundColor="#6B7E8F";}catch(e){}
	try{document.getElementById("bspac3").style.backgroundColor="#6B7E8F";}catch(e){}
	try{document.getElementById("bspac4").style.backgroundColor="#6B7E8F";}catch(e){}

}

/*try{
document.getElementById("gftmainmenu").title="";
document.getElementById("gftmainmenu").removeEventListener('click',openHomeImageBannerLink,false);
}catch(e){}*/

	}





	function disableSubMenu(id,eFlag)

	{
		
		document.getElementById("mshadow1").style.display="none";
		document.getElementById("nomshadow1").style.display="";
		document.getElementById("mshadow2").style.display="none";
		document.getElementById("nomshadow2").style.display="";
		document.getElementById("mshadow3").style.display="none";
		document.getElementById("nomshadow3").style.display="";
		document.getElementById("mshadow4").style.display="none";
		document.getElementById("nomshadow4").style.display="";
		try{document.getElementById("mshadow5").style.display="none";}catch(e){}
		try{document.getElementById("nomshadow5").style.display="";}catch(e){}
		document.getElementById("mshadowc1").style.display="none";
		document.getElementById("mshadowc2").style.display="none";
		document.getElementById("mshadowc3").style.display="none";
		document.getElementById("mshadowc4").style.display="none";
		try{document.getElementById("mshadowc5").style.display="none";}catch(e){}
		try{document.getElementById("mshadowc5a").style.display="none";}catch(e){}
		
		var topMenuid = "cellt"+id.charAt(5);
		var topAnchorid = "anchort"+id.charAt(5);
			var subMenuid ="cellb"+id.charAt(5);
				if(document.getElementById(topMenuid).childNodes[0].innerHTML != null && document.getElementById(topMenuid).childNodes[0].innerHTML !="" )
	{
		hidesubmenu();
			if(eFlag)document.getElementById(subMenuid).style.backgroundColor="";
			document.getElementById("rowDivDown").style.visibility="hidden";
				
			//document.getElementById(topMenuid).style.backgroundColor="";
		if(eFlag)document.getElementById(topMenuid).style.backgroundColor='#E4EBF6';
		if(eFlag){
		if(document.getElementById(topAnchorid).className!="topNavLevelAct")
			document.getElementById(topAnchorid).className="topNavLevel";
		}
		
			
	}
		document.getElementById("tspac1").style.backgroundColor="";
		document.getElementById("tspac2").style.backgroundColor="";
		try{document.getElementById("tspac3").style.backgroundColor="";}catch(e){}
		try{document.getElementById("tspac4").style.backgroundColor="";}catch(e){}	
		try{document.getElementById("bspac1").style.backgroundColor="";}catch(e){}
		try{document.getElementById("bspac2").style.backgroundColor="";}catch(e){}
		try{document.getElementById("bspac3").style.backgroundColor="";}catch(e){}
		try{document.getElementById("bspac4").style.backgroundColor="";}catch(e){}
		//try{document.getElementById(id).style.backgroundColor="#BD7B01";}catch(e){}
	

}
function disableSubMenu4High(id,eFlag)
{
disableSubMenu(id,eFlag);
if(eFlag)document.getElementById("cellt"+id.charAt(5)).style.backgroundColor="#627995";
}

///c09CoLaDef Start///
var hidectryTimer;

function showctry(){
if(htmlloadflag==true){
try{
clearTimeout(hidectryTimer);
}catch(e){}
setcrtyListpos();
document.getElementById("DDme").style.visibility="visible";
document.getElementById('coarrowno').style.display="none";
document.getElementById('coarrowro').style.display="";
}
}

function hidectry(){
if(htmlloadflag==true){
document.getElementById("DDme").style.visibility="hidden";
document.getElementById('coarrowno').style.display="";
document.getElementById('coarrowro').style.display="none";
}
}

function timedMsg()
{
if(htmlloadflag==true){
hidectryTimer=setTimeout("hidectry()",100);
}
}

function setcrtyListpos(){
if(htmlloadflag==true){
offsetval = c09CoLaDefOffsetTop;
var x = getXY( document.getElementById('countryanchor') ).x ;
var y = getXY( document.getElementById('countryanchor') ).y;
document.getElementById("DDme").style.top = y-(parseInt(offsetval))+"px";
document.getElementById("DDme").style.left = x+"px";
}
}

///c09CoLaDef End///



//Search box script start /////

 function searchbtnsro(){
 	document.getElementById("searchbtnno").style.display = "none";
 	document.getElementById("searchbtnro").style.display = "";
	
 }
 function searchbtnsrout(){
 	document.getElementById("searchbtnno").style.display = "";
 	document.getElementById("searchbtnro").style.display = "none";
 }
 
function onenter(myfield, e, checktitle)
{
var key;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;

if(key==13) 
{

 return searchsubmit(myfield,checktitle);

}

return true;
}

function searchsubmit(obj,checktitle){

SetCookie("ptlink", "1")
SetCookie("ptcurrent", "1")

var val = obj.value;
val = trim(val);

if(checktitle != val && (val.length+"") !="0"){
document.getElementById("c09SearchForm").submit();
}
return false;
}
function onfocusevent(obj, searchkeywordtitle ){
if(obj.value == searchkeywordtitle)
obj.value="";
}

function onblurevent(obj, searchkeywordtitle){

 var val = obj.value;
val = trim(val);
if(val == "" || val.length == 0)
obj.value=searchkeywordtitle;
}
 

 /////Search box script end ////

///Util ////
/**
* trims the given string and retuns it.
*
* param: totrim - String to trim
*
*/
function trim(totrim){
return totrim.replace(/^\s*(.*)/, "$1").replace(/(.*?)\s*$/, "$1");
}

/**
* gets the x and y coordinates of the given object
*
* param: obj - Object whose x and y coordinates are to be known
*/
function getXY(obj)
{
  var curleft = 0;
  var curtop = obj.offsetHeight + 0;
  var border;
  if (obj.offsetParent)
  {
    do
    {
      // XXX: If the element is position: relative we have to add borderWidth
      if (getStyle(obj, 'position') == 'relative')
      {
        if (border = getStyle(obj, 'border-top-width')) curtop += parseInt(border);
        if (border = getStyle(obj, 'border-left-width')) curleft += parseInt(border);
      }
      curleft += obj.offsetLeft;
      curtop += obj.offsetTop;
    }
    while (obj = obj.offsetParent)
  }
  else if (obj.x)
  {
    curleft += obj.x;
    curtop += obj.y;
  }
  return {'x': curleft, 'y': curtop};
}

/**
* gets the value of the given style attribute for the given Object
*
* param: obj - Object 
*        styleProp - style attribute whose value to be known
*/
function getStyle(obj, styleProp)
{
  if (obj.currentStyle)
    return obj.currentStyle[styleProp];
  else if (window.getComputedStyle)
    return document.defaultView.getComputedStyle(obj,null).getPropertyValue(styleProp);
}

///Util end ////




function backGroundOn(divId,bgImg){
//	try{
//clearTimeout(menuinterVal);
//}catch(e){}
//document.getElementById(divId).style.backgroundImage="url('"+bgImg+"')";

}

function backGroundOff(divId){
//menuinterVal = setTimeout("backGroundOffInterval('"+divId+"')",100);
}
function backGroundOffInterval(divId){
document.getElementById(divId).style.backgroundImage="url('')";

}

function openwindow()
{
//var currenturl = document.URL+"";
var currenturl = window.location+"";
var mailUrl = currenturl.replace(".html",".sendtofriend.html");
	var ms_width=((screen.width/2)-191)-8;
    var ms_height=((screen.height/2)-260)-18;
  openPopup=window.open(mailUrl, "GFTMailToFriendSite","status=no,toolbar=no,menubar=no,titlebar=no,location=no,scrollbars=no,width=382,height=520,left="+ms_width+",top="+ms_height);
    openPopup.focus();

}
function openPrintPreview(siteName)
{
var currenturl = window.location+"";

var printUrl = currenturl.replace(".html",".print.html");

	var ms_width=((screen.width/2)-424)-14;
    var ms_height=((screen.height/2)-280)-18;
     openPopup=window.open(printUrl, "GFTPrint","status=no,toolbar=no,menubar=no,titlebar=no,location=no,scrollbars=yes,width=865,height=560,left="+ms_width+",top="+ms_height);
    openPopup.focus();

}

function openFormPrintPreview(siteName)
{
	var ms_width=((screen.width/2)-424)-14;
    var ms_height=((screen.height/2)-280)-18;
    openPopup=window.open(siteName, "GFTPrintPreview","status=no,toolbar=no,menubar=no,titlebar=no,location=no,scrollbars=yes,width=865,height=560,left="+ms_width+",top="+ms_height);
    openPopup.focus();
}

function openBookMark(urlPart1,urlPart2)
{
var bmurl = urlPart1+window.location+urlPart2;
bmurl = convertToUrlSafe(bmurl);
bmurl = bmurl.replace(/@26@/g,"%26");
window.open(bmurl);

}

function openGFTPlainWindow(gftlinkurl)
{
	window.open(gftlinkurl);

}

function footerOn(id)
{

if(id.charAt(0)=="p")
{

document.getElementById("printtxt").style.color = "#BE7C00";


}
else
{
document.getElementById("stftxt").style.color = "#BE7C00";
}
}

function footerOff(id)
{

if(id.charAt(0)=="p")
{

document.getElementById("printtxt").style.color = "#627995";

}
else
{
document.getElementById("stftxt").style.color = "#627995";
}

}

function validateEmail(elem) {

     var src="";
     try{
        src=document.getElementById(elem).value;
	 } 
     catch(e){
	 	src=elem;
	 }
     var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
     var regex = new RegExp(emailReg);
    if(regex.test(src))
{
return true; }
else{
return false;
} 
}

function validateEmailValueOrg(value) {

     var src="";
     try{
        src=value;
	 } 
     catch(e){
	 	src=elem;
	 }
     var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
     var regex = new RegExp(emailReg);
    if(regex.test(src))
{
return true; }
else{
return false;
} 
}

var bugchars = '!#$^&*()+|}{[]?><~%:;/,=`"\'';
function CharsInBag(s)
{   var i;
var lchar="";
    // Search through string's characters one by one.
    // If character is not in bag.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
		if(i>0)lchar=s.charAt(i-1)
        if (bugchars.indexOf(c) != -1 || (lchar=="." && c==".")) return false;
    }
    return true;
}
function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is not a number.
        var c = s.charAt(i);
        if ((c >= "0") && (c <= "9") && (c != ".")) return false;
    }
    // All characters are numbers.
    return true;
}
function validateEmailValue(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		var lastdot=str.lastIndexOf(dot)
		if (str.indexOf(at)==-1){
		   //alert("Invalid E-mail ID")
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   //alert("Invalid E-mail ID")
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr || str.substring(lastdot+1)==""){
		    //alert("Invalid E-mail ID")
		    return false
		}
		 
		 if (str.indexOf(at,(lat+1))!=-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    //alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }
		if(CharsInBag(str)==false){
		    //alert("Invalid E-mail ID")
		    return false
		 }
		 var arrEmail=str.split("@")
		 var ldot=arrEmail[1].indexOf(".")
		 if(isInteger(arrEmail[1].substring(ldot+1))==false){
		    //alert("Invalid E-mail ID")
		    return false
		 }
 		 return true					
	}

function validateSendEmail() {

document.getElementById("sendBtn").style.backgroundColor='#bd7b01';
document.getElementById("c0SendmailToIdErrorGap").style.display="none";
document.getElementById("c0SendmailToIdError").style.display="none";
document.getElementById("c0SendmailFromIdErrorGap").style.display="none";
document.getElementById("c0SendmailFromIdError").style.display="none";

var toFlag = true;
var fromFlag = true;

var toEmail = document.getElementById("toAddress").value;
var fromEmail = document.getElementById("fromAddress").value;
if(toEmail==""){
	document.getElementById("sendBtn").style.backgroundColor='#5a7c97';
	toFlag = false;
}

if(fromEmail==""){
	document.getElementById("sendBtn").style.backgroundColor='#5a7c97';
	fromFlag = false;
}

if(toEmail.indexOf(",")!=-1){
var allToEmail = toEmail.split(",");
for(var i=0; i<allToEmail.length;i++){
if(validateEmailValue(allToEmail[i])==false){
document.getElementById("sendBtn").style.backgroundColor='#5a7c97';
toFlag = false;
}
}
}
else if(validateEmailValue(toEmail)==false){
document.getElementById("sendBtn").style.backgroundColor='#5a7c97';
toFlag = false;
}


if(validateEmailValue(fromEmail)==false){
document.getElementById("sendBtn").style.backgroundColor='#5a7c97';
fromFlag = false;
}

if(!toFlag){
document.getElementById("c0SendmailToIdErrorGap").style.display="";
document.getElementById("c0SendmailToIdError").style.display="";
}

if(!fromFlag){
document.getElementById("c0SendmailFromIdErrorGap").style.display="";
document.getElementById("c0SendmailFromIdError").style.display="";
}
if(!toFlag || !fromFlag){
document.getElementById("sendBtn").style.backgroundColor='#5a7c97';
return false;
}

document.getElementById("sendEmail").submit();
return true;

}

function changeStyleClass(object, className)
{
	object.className = className;
}

function SetCookie(sName, sValue)
{
    document.cookie = sName + "=" + escape(sValue) + "; expires=Fri, 31 Dec 2099 23:59:59 GMT;";
}
function GetCookie(sName)
{
  // cookies are separated by semicolons
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
    // a name/value pair (a crumb) is separated by an equal sign
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0])
      return unescape(aCrumb[1]);
  }

  // a cookie with the requested name does not exist
  return null;
}

////////////Form Element functions Start/////////////
var ns6=document.getElementById && !document.all;
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1;
var formElemList1="|";
var formElemList2="|";
var formElemList3="|";
var formElemList4="|";
var formElemList5="|";
var formElemList6="|";
var formElemList7="|";
var formElemList8="|";

function setHowCanHelp(elemname)
{

var selObj=document.getElementsByName("othercatselect_"+elemname);
var textObj=document.getElementById("othercattext_"+elemname);
document.getElementById(elemname).value=selObj[0].value+" -> "+textObj.value;
//alert(document.getElementById(elemname).value);
}
function checkother4land(thiselem,othervalues,elemname)
{
var selObj=document.getElementsByName("othercatselect_"+elemname);
var textObj=document.getElementById("othercattext_"+elemname);
if(othervalues.indexOf("|"+thiselem.value+"|")!=-1)
{
document.getElementById("othercattext_"+elemname).style.display="";
document.getElementById(elemname).value=selObj[0].value+" -> "+textObj.value;
}
else
{
document.getElementById("othercattext_"+elemname).style.display="none";
document.getElementById("othercattext_"+elemname).value="";
document.getElementById(elemname).value=selObj[0].value;
}
}

function resetFormElem(){
try{
	var fel1 = formElemList1.split("|");
	for(var i=0; i<fel1.length; i++){
		try{document.getElementsByName(fel1[i])[0].style.display="none";}catch(oe){}
	}
}catch(e){}
try{
	var fel2 = formElemList2.split("|");

	for(var i=0; i<fel2.length; i++){
		try{
			document.getElementsByName(fel2[i])[0].innerHTML="";
		}catch(oe){}
	}
}catch(e){}
try{
	var fel3 = formElemList3.split("|");
	for(var i=0; i<fel3.length; i++){
		try{
			document.getElementsByName(fel3[i])[0].value="|";			
		}catch(oe){}
	}
}catch(e){}
try{
	var fel4 = formElemList4.split("|");
	for(var i=0; i<fel4.length; i++){
		try{
	document.getElementsByName(fel4[i])[0].value="1";			
		}catch(oe){ }
	}
}catch(e){}
try{
	var fel5 = formElemList5.split("|");
	for(var i=0; i<fel5.length; i++){
		try{
			document.getElementsByName(fel5[i])[0].style.display="none";		
		}catch(oe){}
	}
}catch(e){}
try{
	var fel6 = formElemList6.split("|");
	for(var i=0; i<fel6.length; i++){
		try{
			document.getElementsByName(fel6[i])[0].style.display="none";		
		}catch(oe){}
	}
}catch(e){}

try{
	var fel7 = formElemList7.split("|");
	
	for(var i=0; i<fel7.length; i++){
		try{
			var fileObjName = document.getElementsByName(fel7[i])[0].name;
			if(fileObjName.indexOf("_gftformfile_")!=-1)
			fileObjName = fileObjName.substring(0,fileObjName.lastIndexOf("_"))+"_1";
			var fileObj = document.getElementsByName(fel7[i])[0];			
			fileObj.name=fileObjName;
			fileObj.id=fileObjName;
		}catch(oe){}
	}
}catch(e){}
try{
	var fel8 = formElemList8.split("|");

	for(var i=0; i<fel8.length; i++){
		try{
			document.getElementsByName(fel8[i])[0].innerHTML="";
		}catch(oe){}
	}
}catch(e){}
}

function clrMe(t){
if(t.defaultValue==t.value){
t.value = '';
t.style.color="#000000";
}
}

function copyFileAttachElemTxt(Id,defaultsrc,oversrc,setwidth,setsize,removeTxt,attachIcon,thisObj)
{

var fileBrowseDiv = document.getElementById(Id+"_fileDivOpt");

var fileCount = parseInt(document.getElementById("filesCount_"+Id).value);
var file_val = document.getElementById(Id+"_gftformfile_"+fileCount).value;
var allfile_obj = document.getElementById("allFileNames_"+Id);
if(file_val!="" && allfile_obj.value.indexOf(file_val)<0)
{

if(document.getElementById(Id+"_gftformfile_"+fileCount).value!=""){
var brObj = document.createElement("BR");
brObj.id=Id+"_br_"+fileCount;

var attachCell = document.getElementById(Id+"_attachCell");
var attachTnode = document.createTextNode(" "+document.getElementById(Id+"_gftformfile_"+fileCount).value);
allfile_obj.value = allfile_obj.value+document.getElementById(Id+"_gftformfile_"+fileCount).value+"|";
var attachNobr = document.createElement("NOBR");
attachNobr.id = Id+"_nobr_"+fileCount;
var attachRemLink = document.createElement("A");
attachRemLink.href="javascript:removeAttachment('"+Id+"',"+fileCount+");";
attachRemLink.title=removeTxt;
attachRemLink.onmouseover=function(){ changeStyleClass(this, 'contenttextlinkhigh'); };
attachRemLink.onmouseout=function(){ changeStyleClass(this, 'contenttextlink'); };
attachRemLink.className="contenttextlink";
var attachRemText = document.createTextNode(removeTxt+" ");
attachRemLink.appendChild(attachRemText);
var attachIconImg = document.createElement("IMG");
attachIconImg.src = attachIcon;
attachIconImg.width= "11";
attachIconImg.height= "12";
attachIconImg.style.marginTop="4px";
attachIconImg.style.marginBottom="-2px";
attachIconImg.alt= document.getElementById(Id+"_gftformfile_"+fileCount).value;
attachIconImg.title= document.getElementById(Id+"_gftformfile_"+fileCount).value;
var attachSpan = document.createElement("SPAN");
attachSpan.title= document.getElementById(Id+"_gftformfile_"+fileCount).value;
attachSpan.className="contenttext";
attachSpan.style.width=setwidth;

var attachSpanTable = document.createElement("TABLE");
attachSpanTable.cellPadding="0";
attachSpanTable.cellSpacing="0";
attachSpanTable.border="1";

var attachSpanTableTR = document.createElement("TR");
var attachSpanTableTD1 = document.createElement("TD");
var attachSpanTableTD2 = document.createElement("TD");

attachSpanTableTD1.appendChild(attachRemLink);
attachSpanTableTD1.appendChild(attachIconImg);
attachSpanTableTD2.appendChild(attachTnode);
attachSpanTableTR.appendChild(attachSpanTableTD1);
attachSpanTableTR.appendChild(attachSpanTableTD2);
attachSpanTable.appendChild(attachSpanTableTR);

attachNobr.appendChild(attachSpanTable);

var splitedText = document.getElementById(Id+'_gftformfile_'+fileCount).value;

if(ns6){
document.getElementById(Id+"_calculateLayer").innerHTML = "<TABLE cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td width=\""+setwidth+"\" valign=\"top\"><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr id=\""+Id+"_fileTR_"+fileCount+"\"><td valign=\"top\">"+
						"<a href=\"javascript:removeAttachment('"+Id+"',"+fileCount+");\" title=\""+removeTxt+"\""+
						"onmouseover=\"changeStyleClass(this, 'contenttextlinkhigh');\""+
						"onmouseout=\"changeStyleClass(this, 'contenttextlink');\""+
						"class=\"contenttextlink\">"+removeTxt+" "+
						"</a></td>"+
						"<td width=\"2\"></td>"+
						"<td valign=\"top\"><img src=\""+attachIcon+"\" alt\""+document.getElementById(Id+'_gftformfile_'+fileCount).value+"\" title=\""+document.getElementById(Id+'_gftformfile_'+fileCount).value+"\" width=\"11\" height=\"12\" style=\"margin-top:2px;margin-bottom:-2px;\"/></td>"+
						"<td width=\"2\"></td>"+
						"<td width=\"100%\"class=\"black11\" style=\"WORD-BREAK:BREAK-ALL;\" valign=\"top\">"+splitedText+"</td></tr></table></td><td id=\""+Id+"_fileTD_"+fileCount+"\"></td></tr></table>";

var inxVal=0;
var ptrVal=0;
var ptrLen=splitedText.length;
var strLen=splitedText.length;
var splitedStr = "";
while((parseInt(setwidth+2)+2)<document.getElementById(Id+"_calculateLayer").offsetWidth){

var newSplitedText = splitedText.substring(inxVal,ptrLen);
document.getElementById(Id+"_calculateLayer").innerHTML = "<TABLE cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td width=\""+setwidth+"\" valign=\"top\"><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr id=\""+Id+"_fileTR_"+fileCount+"\"><td valign=\"top\">"+
						"<a href=\"javascript:removeAttachment('"+Id+"',"+fileCount+");\" title=\""+removeTxt+"\""+
						"onmouseover=\"changeStyleClass(this, 'contenttextlinkhigh');\""+
						"onmouseout=\"changeStyleClass(this, 'contenttextlink');\""+
						"class=\"contenttextlink\">"+removeTxt+" "+
						"</a></td>"+
						"<td width=\"2\"></td>"+
						"<td valign=\"top\"><img src=\""+attachIcon+"\" alt\""+document.getElementById(Id+'_gftformfile_'+fileCount).value+"\" title=\""+document.getElementById(Id+'_gftformfile_'+fileCount).value+"\" width=\"11\" height=\"12\" style=\"margin-top:2px;margin-bottom:-2px;\"/></td>"+
						"<td width=\"2\"></td>"+
						"<td width=\"100%\"class=\"black11\" style=\"WORD-BREAK:BREAK-ALL;\" valign=\"top\">"+newSplitedText+"</td></tr></table></td><td id=\""+Id+"_fileTD_"+fileCount+"\"></td></tr></table>";
if((parseInt(setwidth)+2)>=document.getElementById(Id+"_calculateLayer").offsetWidth){
ptrLen--;
newSplitedText = splitedText.substring(inxVal,ptrLen)+"<br/>"+splitedText.substring(ptrLen,strLen);
splitedText=newSplitedText;
ptrLen=splitedText.length;
strLen=splitedText.length;
document.getElementById(Id+"_calculateLayer").innerHTML = "<TABLE cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td width=\""+setwidth+"\" valign=\"top\"><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr id=\""+Id+"_fileTR_"+fileCount+"\"><td valign=\"top\">"+
						"<a href=\"javascript:removeAttachment('"+Id+"',"+fileCount+");\" title=\""+removeTxt+"\""+
						"onmouseover=\"changeStyleClass(this, 'contenttextlinkhigh');\""+
						"onmouseout=\"changeStyleClass(this, 'contenttextlink');\""+
						"class=\"contenttextlink\">"+removeTxt+" "+
						"</a></td>"+
						"<td width=\"2\"></td>"+
						"<td valign=\"top\"><img src=\""+attachIcon+"\" alt\""+document.getElementById(Id+'_gftformfile_'+fileCount).value+"\" title=\""+document.getElementById(Id+'_gftformfile_'+fileCount).value+"\" width=\"11\" height=\"12\" style=\"margin-top:2px;margin-bottom:-2px;\"/></td>"+
						"<td width=\"2\"></td>"+
						"<td width=\"100%\"class=\"black11\" style=\"WORD-BREAK:BREAK-ALL;\" valign=\"top\">"+newSplitedText+"</td></tr></table></td><td id=\""+Id+"_fileTD_"+fileCount+"\"></td></tr></table>";
}
ptrLen--;
}
}



attachNobr.innerHTML = "<TABLE cellspacing=\"0\" cellpadding=\"0\" border=\"0\" ><tr><td width=\""+setwidth+"\" valign=\"bottom\"><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" height=\"20px\"><tr id=\""+Id+"_fileTR_"+fileCount+"\"><td valign=\"top\">"+
						"<a href=\"javascript:removeAttachment('"+Id+"',"+fileCount+");\" title=\""+removeTxt+"\""+
						

						"class=\"contenttextlink\">"+removeTxt+" "+
						"</a></td>"+
						"<td width=\"2\"></td>"+
						"<td valign=\"top\"><img src=\""+attachIcon+"\" alt\""+document.getElementById(Id+'_gftformfile_'+fileCount).value+"\" title=\""+document.getElementById(Id+'_gftformfile_'+fileCount).value+"\" width=\"11\" height=\"12\" style=\"margin-top:2px;margin-bottom:-2px;\"/></td>"+
						"<td width=\"2\"></td>"+
						"<td title="+splitedText+" width=\"100%\" class=\"black11\" style=\"cursor:default;\" valign=\"top\"><span title="+splitedText+" cursor=\"default\" width=\"100%\" class=\"black11\" style=\"cursor:default;\">"+splitedText+"</span></td></tr></table></td><td id=\""+Id+"_fileTD_"+fileCount+"\"></td></tr></table>";

attachCell.appendChild(attachNobr);
document.getElementById(Id+"_filesLayer").appendChild(document.getElementById(Id+"_gftformfile_"+fileCount));
document.getElementById(Id+"_attachTable").style.display="";
fileCount=fileCount+1;
document.getElementById("filesCount_"+Id).value=fileCount;
var newInnerObj = "<input type=\"file\" class=\"fileBox\" id=\""+Id+"_gftformfile_"+fileCount+"\" name=\""+Id+"_gftformfile_"+fileCount+"\" size=\""+setsize+"\" style=\"width:"+setwidth+"px;\" onkeydown=\"setFileElemTxtFocus('"+Id+"');\" onmouseover=\"linkImgOnOff('"+Id+"_browseBtn','"+oversrc+"')\" onmouseout=\"copyFileAttachElemTxt('"+Id+"','"+defaultsrc+"','"+oversrc+"','"+setwidth+"','"+setsize+"','"+removeTxt+"','"+attachIcon+"'); linkImgOnOff('"+Id+"_browseBtn','"+defaultsrc+"')\" />";
fileBrowseDiv.innerHTML = newInnerObj;
formElemList7=formElemList7+Id+"_gftformfile_"+fileCount+"|";

}

}
}



function removeAttachment(Id,fileCount){
var attachCell = document.getElementById(Id+"_attachCell");
var attachBr = document.getElementById(Id+"_br_"+fileCount);
var attachNobr = document.getElementById(Id+"_nobr_"+fileCount);

var attachFileVal = "|"+document.getElementById(Id+"_gftformfile_"+fileCount).value+"|";
var allfile_objVal = document.getElementById("allFileNames_"+Id).value;
var afoVal1 = allfile_objVal.substring(0,(allfile_objVal.indexOf(attachFileVal)+1));
var afoVal2 = allfile_objVal.substring((allfile_objVal.indexOf(attachFileVal)+attachFileVal.length),allfile_objVal.length);

var remStr = afoVal1+afoVal2; 

if(allfile_objVal.indexOf(attachFileVal)==0){
try{ attachCell.removeChild(document.getElementById(Id+"_br_"+(fileCount+1))); }catch(e){}
}
document.getElementById("allFileNames_"+Id).value = remStr;
try{attachCell.removeChild(attachBr); }catch(e){}
attachCell.removeChild(attachNobr);
if(document.getElementById("allFileNames_"+Id).value=="|"){
document.getElementById(Id+"_attachTable").style.display="none";
}
try{
document.getElementById(Id+"_filesLayer").removeChild(document.getElementById(Id+"_gftformfile_"+fileCount));
}catch(e){}
}


function copyFileElemTxt(Id)
{
		 document.getElementById(Id+"_proxyTxt").value="";
		 document.getElementById(Id+"_proxyTxt").value=document.getElementById(Id+"_gftformfile").value;
		 document.getElementById(Id+"_fileDivOpt").style.zIndex=1;
}
function setFileElemDefault(Id)
{
		document.getElementById(Id+"_fileDivOpt").style.zIndex=4;
}
function setFileElemTxtFocus(Id)
{
		document.getElementById(Id+"_proxyTxt").focus();
}
function checksample(elemArray,comp,elem,diff)
{
document.getElementById("bgtxt_"+comp).value=document.getElementById("txt_"+comp).value;
//setTop(document.getElementById(comp+"_default"),comp); 
showLayer(comp); 
showLayer(comp+"up"); 
showLayer(comp+"down");
showLayer(comp+"_mask");
document.getElementById('searchButton').style.zIndex=2; 
document.getElementById(comp).style.zIndex=8; 
//document.getElementById(comp+"up").style.zIndex=9; 
//document.getElementById(comp+"down").style.zIndex=9;


document.getElementById(comp+"_default").style.zIndex="9";
var textbox=document.getElementById("txt_"+comp).value;

var aList2=new Array();
var elemcnt=1;
for(var j=1;j<elemArray.length;j++)
{

if(elemArray[j].toUpperCase().indexOf(textbox.toUpperCase())==0)
{
document.getElementById("white"+j+"TR"+comp).style.display="";
document.getElementById("data"+j+"TR"+comp).style.display="";
elemcnt++;
}
else
{
document.getElementById("white"+j+"TR"+comp).style.display="none";
document.getElementById("data"+j+"TR"+comp).style.display="none";

}

}

if(elemcnt<=7 && elemcnt>0){
document.getElementById(comp).style.height=(elemcnt*16)+(elemcnt-1);
document.getElementById(comp+"_mask").style.height=(elemcnt*16)+(elemcnt+31);
}
else{
document.getElementById(comp).style.height=118;
document.getElementById(comp+"_mask").style.height=150;
}
//alert(elemcnt);
if(elemcnt<=7 && elemcnt>1)
document.getElementById(comp+"down").style.top=findPosY(document.getElementById(comp+"_obj"))+((elemcnt-1)*16)-diff+(elemcnt-2);
else if(elemcnt>7)
document.getElementById(comp+"down").style.top=findPosY(document.getElementById(comp+"_obj"))+((7-1)*16)-diff+5;
else
document.getElementById(comp+"down").style.top=findPosY(document.getElementById(comp+"_obj"))-diff-1;

document.getElementById(comp+"_downFlag").value='true';
setLayerLeft(comp,-160,192);
setLayerLeft(comp+'up',-367,400);
setLayerLeft(comp+'down',-367,400);
setDynamicTop(elem,comp,diff);

}

function linkImgOnOff(id,imgSrc)
{
//	document.getElementById(id).src=imgSrc;
	
}

function linkBOImgOnOff(id,imgSrc)
{
	document.getElementById(id).src=imgSrc;
	
}
////////////Form Element functions end/////////////

/////SCROLL script start ////
		
			function mosovrup(id){
			
				document.getElementById(id+'_normal_up').style.display ="none";
				document.getElementById(id+'_hover_up').style.display ="";
				
			
			}
			function mosovrdwn(id){
			
				document.getElementById(id+'_normal_down').style.display ="none";
				document.getElementById(id+'_hover_down').style.display ="";
				
			
			}
			function mosoutup(id){
				
				document.getElementById(id+'_normal_up').style.display ="";
				document.getElementById(id+'_hover_up').style.display ="none";
				
			
			}
			function mosoutdwn(id){
			
				document.getElementById(id+'_normal_down').style.display ="";
				document.getElementById(id+'_hover_down').style.display ="none";
				
			
			}
var isscroll ;
function scrollup(id, by, count){
isscroll = setInterval("scrollhandleup('"+by+"', '"+id+"', '"+count+"')", 50);
}

function scrolldown(id , by, count){
isscroll = setInterval("scrollhandledn('"+by+"', '"+id+"', '"+count+"')", 50);
}


function scrollhandleup(step, id, count){
	var theight = (parseInt(count)*17)-121;
	var ratio = parseInt(65/(theight/step));
	document.getElementById(id).scrollTop -= ((document.getElementById(id).scrollTop - parseInt(step))<0)?0:parseInt(step)
	var offs = parseInt(document.getElementById(id+"_handle").style.top.replace("px",""))-( Math.round(ratio));
	if((offs)>65){offs= 65; clearInterval(isscroll); }
	if(offs<0){offs=0; clearInterval(isscroll); }
	document.getElementById(id+"_handle").style.top = offs+"px" ;
}

function scrollhandledn(step, id, count){
	var theight = (parseInt(count)*17)-121;
	var ratio = parseInt(65/(theight/step));
	document.getElementById(id).scrollTop += parseInt(step);
	var offs = parseInt(document.getElementById(id+"_handle").style.top.replace("px",""))+( Math.round(ratio));
	if((offs)>65){offs= 65; clearInterval(isscroll); }
	if(offs<0){offs=0; clearInterval(isscroll); }

	document.getElementById(id+"_handle").style.top = offs+"px" ;
}



function stopscroll(){
clearInterval(isscroll);
}
var IE8 = false;
if (window.navigator.appName == "Microsoft Internet Explorer")
{
   if (document.documentMode) // IE8
      IE8 = true;
}
var IE = document.all?true:false
var obj;
var bool = false;
var currY = 0;
var tempY;
var dragTimer;
//if (!IE){ document.captureEvents(Event.MOUSEMOVE);
//document.captureEvents(Event.MOUSEUP);
//}

//document.onmousemove = getMouseXY;
//document.onmouseup = stopit;
function startDrag(obje, id, count){
obj = obje;
currY = tempY;
dragTimer = setInterval("drag('"+id+"','"+count+"')", 10);
bool = true;


}

function drag(id, count){
  if(bool){
	var ratio = (((parseInt(count)+1)*17)-124)/80;

	var pos = currY - tempY;
	var ste = parseInt(obj.style.top.replace("px","").replace("pt",""))-pos;
	if (ste < 0){ste = 0}  
	if (ste > 65){ste = 65}
 	obj.style.top = ste+"px";
	document.getElementById(id).scrollTop = parseInt(ste * ratio);
 }
currY = tempY;
}
function getMouseXY(e) {
if(htmlloadflag){

  if (IE) { // grab the x-y pos.s if browser is IE
    //tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    //tempX = e.pageX
    tempY = e.pageY
  }  

 //document.Show.MouseX.value = tempX
  //document.Show.MouseY.value = tempY
	
  return true
}
}

function stopit(e){
try{
clearInterval(dragTimer);}catch(e){}
try{
clearInterval(isscroll);}catch(e){}
bool = false;
}
/////SCROLL script end ////
/////Drop Down script start ////


function setdropdownpos(offsetval, parent, child){
if(htmlloadflag==true){
var x = getXY( document.getElementById(parent) ).x;
var y = getXY( document.getElementById(parent) ).y;
var w = getStyle(document.getElementById(parent), 'width');

document.getElementById(child).style.width = parseInt(w)+24+"px";
document.getElementById(child).style.position = "absolute";
document.getElementById("drop09_"+parent).style.width = parseInt(w)+24+"px";
if(IE8 || ns6){
document.getElementById(child).style.left = (x-6)+"px";
document.getElementById(child).style.top = y-(parseInt(offsetval))+"px";
try{
document.getElementById("su_"+parent).style.top = parseInt(document.getElementById(child).style.top.replace("px",""))+"px";
document.getElementById("sd_"+parent).style.top =  parseInt(document.getElementById(child).style.top.replace("px","")) + 98+"px";
document.getElementById("su_"+parent).style.left =  parseInt(document.getElementById(child).style.left.replace("px",""))+parseInt(w)+6+"px";
document.getElementById("sd_"+parent).style.left =  parseInt(document.getElementById(child).style.left.replace("px",""))+parseInt(w)+6+"px";
}catch(e){}
}
else{
document.getElementById(child).style.left = (x-4)+"px";
document.getElementById(child).style.top = (y-(parseInt(offsetval))+3)+"px";
try{
document.getElementById("su_"+parent).style.top = parseInt(document.getElementById(child).style.top.replace("px",""))+"px";
document.getElementById("sd_"+parent).style.top =  parseInt(document.getElementById(child).style.top.replace("px","")) + 98+"px";
document.getElementById("su_"+parent).style.left =  parseInt(document.getElementById(child).style.left.replace("px",""))+parseInt(w)+6+"px";
document.getElementById("sd_"+parent).style.left =  parseInt(document.getElementById(child).style.left.replace("px",""))+parseInt(w)+6+"px";
}catch(e){}
}

try{

document.getElementById("scroll_"+parent).style.top = parseInt(document.getElementById(child).style.top.replace("px",""))+"px";
}catch(e){}
clearInterval(window["ddtimer_"+parent]);


}
}

function setdropdownpos4finder(offsetval, parent, child){
if(htmlloadflag==true){
var x = getXY( document.getElementById(parent) ).x;
var y = getXY( document.getElementById(parent) ).y;
var w = getStyle(document.getElementById(parent), 'width');

document.getElementById(child).style.width = parseInt(w)+24+"px";
document.getElementById(child).style.position = "absolute";
//document.getElementById("ddiv09box_"+parent).style.width = parseInt(w)+24+"px";

if(IE8 || ns6){
document.getElementById(child).style.left = (x-6)+"px";
document.getElementById(child).style.top = y-(parseInt(offsetval))+"px";
}
else{
document.getElementById(child).style.left = (x-4)+"px";
document.getElementById(child).style.top = (y-(parseInt(offsetval))+3)+"px";
}

try{
//alert(child+" , "+ parent.replace("h_","")+"_append")
document.getElementById(parent.replace("h_","")+"_append").style.width = 	parseInt(document.getElementById(child).style.width.replace("px",""))-20+"px";
document.getElementById("su_"+parent.replace("h_","")).style.top = parseInt(document.getElementById(child).style.top.replace("px",""))+"px";
document.getElementById("sd_"+parent.replace("h_","")).style.top =  parseInt(document.getElementById(child).style.top.replace("px","")) + 98+"px";
document.getElementById("su_"+parent.replace("h_","")).style.left =  parseInt(document.getElementById(child).style.left.replace("px",""))+parseInt(w)+6+"px";
document.getElementById("sd_"+parent.replace("h_","")).style.left =  parseInt(document.getElementById(child).style.left.replace("px",""))+parseInt(w)+6+"px";
}catch(e){}

clearInterval(window["ddtimer_"+parent]);
}
}



function setdropdownpos4NE(offsetval, parent, child){
if(htmlloadflag==true){
var x = getXY( document.getElementById(parent) ).x;
var y = getXY( document.getElementById(parent) ).y;
var w = getStyle(document.getElementById(parent), 'width');

document.getElementById(child).style.width = parseInt(w)+24+"px";
document.getElementById(child).style.position = "absolute";
document.getElementById("ddiv09wbox_"+parent).style.width = parseInt(w)+24+"px";

if(IE8 || ns6){
document.getElementById(child).style.left = (x-6)+"px";
document.getElementById(child).style.top = y-(parseInt(offsetval))+"px";
}
else{
document.getElementById(child).style.left = (x-4)+"px";
document.getElementById(child).style.top = (y-(parseInt(offsetval))+3)+"px";
}

try{
//alert(child+" , "+ parent.replace("h_","")+"_append finder")
document.getElementById(parent.replace("h_","")+"_append").style.width = 	parseInt(document.getElementById(child).style.width.replace("px",""))-20+"px";
document.getElementById("su_"+parent.replace("h_","")).style.top = parseInt(document.getElementById(child).style.top.replace("px",""))+"px";
document.getElementById("sd_"+parent.replace("h_","")).style.top =  parseInt(document.getElementById(child).style.top.replace("px","")) + 98+"px";
document.getElementById("su_"+parent.replace("h_","")).style.left =  parseInt(document.getElementById(child).style.left.replace("px",""))+parseInt(w)+6+"px";
document.getElementById("sd_"+parent.replace("h_","")).style.left =  parseInt(document.getElementById(child).style.left.replace("px",""))+parseInt(w)+6+"px";
}catch(e){}

clearInterval(window["ddtimer_"+parent]);
}
}

function showdropdown(_pos,_id,id){
if(htmlloadflag==true){
try{setdropdownpos(_pos,_id,id);}catch(e){}
try{setdropdownpos4NE(_pos,_id,id);}catch(e){}
try{setdropdownpos4finder(_pos,_id,id);}catch(e){}
try{
clearTimeout(window["hidedropdowncallTimer_"+id]);
}catch(e){}

document.getElementById(id).style.display="block";
document.getElementById('ARN_'+id).style.display="none";
document.getElementById('ARO_'+id).style.display="";
try{
document.getElementById("su_"+id.replace("DD_","")).style.display="";
document.getElementById("sd_"+id.replace("DD_","")).style.display="";
}catch(e){}
}
}

function hidedropdowncall(id){

document.getElementById(id).style.display="none";
document.getElementById('ARO_'+id).style.display="none";
document.getElementById('ARN_'+id).style.display="";
try{
document.getElementById("su_"+id.replace("DD_","")).style.display="none";
document.getElementById("sd_"+id.replace("DD_","")).style.display="none";
}catch(e){}

}


function hidedropdown(id)
{
window["hidedropdowncallTimer_"+id]=setTimeout("hidedropdowncall('"+id+"')",100);
}

function checkhide(objId,id, hiddenid, eve){

if(eve.keyCode == 9){
	hidedropdown(id);
	redraw(objId,id, hiddenid);
}
}

function hidevalue(current,ddid, count){
for(var i = 1; i<= parseInt(count); i++){
var getid = ddid+"_"+i;
if(current.id != getid){
document.getElementById(getid).style.display = 'block';
}else{
document.getElementById(getid).style.display = 'none';
}
}
}
 

function suggestlistJobs(obj, id){
	if(htmlloadflag==true){
	document.getElementById(id).style.display="block";
	var val = document.getElementById(id+"_count").value;
   	var typedtext = obj.value;
	var count = 0;

	 if(typedtext.length>0){

		for(var i = 1; i<= parseInt(val); i++){
		var getid = id+"_"+i;
			var temp = document.getElementById(getid).innerHTML.replace(/^\s*(.*)/, "$1").replace(/(.*?)\s*$/, "$1"); 
	 
			if(typedtext.length<=temp.length){

				var check = temp.substring(0,typedtext.length);

				if(check.toString().toLowerCase() == typedtext.toString().toLowerCase()){
					
					document.getElementById(getid).style.display = 'block';
			
					count++;			
				}else{
					document.getElementById(getid).style.display = 'none';
				}

			}else{
					document.getElementById(getid).style.display = 'none';
				}
		}


	 }else{
		for(var i = 1; i<= parseInt(val); i++){
			var getid = id+"_"+i;
			document.getElementById(getid).style.display = 'block';
			count++;
			}

	 }
   }
 }

function suggestlist(obj, id, val){
	if(htmlloadflag==true){
	document.getElementById(id).style.display="block";

   	var typedtext = obj.value;
	var count = 0;

	 if(typedtext.length>0){

		for(var i = 1; i<= parseInt(val); i++){
		var getid = id+"_"+i;
			var temp = document.getElementById(getid).innerHTML.replace(/^\s*(.*)/, "$1").replace(/(.*?)\s*$/, "$1"); 
	 
			if(typedtext.length<=temp.length){

				var check = temp.substring(0,typedtext.length);

				if(check.toString().toLowerCase() == typedtext.toString().toLowerCase()){
					
					document.getElementById(getid).style.display = 'block';
			
					count++;			
				}else{
					document.getElementById(getid).style.display = 'none';
				}

			}else{
					document.getElementById(getid).style.display = 'none';
				}
		}


	 }else{
		for(var i = 1; i<= parseInt(val); i++){
			var getid = id+"_"+i;
			document.getElementById(getid).style.display = 'block';
			count++;
			}

	 }
   }
 }

/* old suggest
function suggestlist(obj, id, val){

showdropdown(id);
  var vals = val.toString().split("||");

  var html = "";
 var typedtext = obj.value;
var count = 0;
var n = "";
 if(typedtext.length>0){

	for (var i = 0; i< vals.length; i++){
		var temp = vals[i]; 
		if(i==0){n='none';
 }else{n='';}
	 
		if(typedtext.length<=temp.length){

			var check = temp.substring(0,typedtext.length);
			if(check.toLowerCase() == typedtext.toLowerCase()){
			html +="<div  style='clear: both;cursor: hand; cursor: pointer;padding-left:5px;' onmouseover=\"javascript: this.style.color = '#BE7C00';\" onmouseout=\"javascript: this.style.color = '#000000';\" onclick=\"javascript: document.getElementById('h_"+obj.id+"').value='"+n+"';document.getElementById('"+obj.id+"').value='"+vals[i]+"';hidedropdown('"+id+"');redraw('"+obj.id+"','"+id+"', 'val_"+obj.id+"');\">"+vals[i]+"</div>";
			
			count++;			
			}
		}
	}

	//document.getElementById(id).innerHTML = html;
 }else{
	for (var i = 0; i< vals.length; i++){
		if(i==0){n='none';
 }else{n='';}
		html +="<div  style='clear: both;cursor: hand; cursor: pointer;padding-left:5px;' onmouseover=\"javascript: this.style.color = '#BE7C00';\" onmouseout=\"javascript: this.style.color = '#000000';\" onclick=\"javascript : document.getElementById('h_"+obj.id+"').value='"+n+"';document.getElementById('"+obj.id+"').value='"+vals[i]+"';hidedropdown('"+id+"');redraw('"+obj.id+"','"+id+"', 'val_"+obj.id+"');\">"+vals[i]+"</div>";
		count++;
		}

}
	if(count>7){
		//document.getElementById(id).innerHTML = "<div style=\"height:116px;overflow:auto;\">"+html+"</div>";
		document.getElementById(id+"_append").innerHTML = "<div id='scroll_"+id+"'style=\"height:116px;overflow:hidden;float: left\">"+html+"</div>";
		document.getElementById(id+"_append").style.width = 	parseInt(document.getElementById(id).style.width.replace("px",""))-20+"px";
		document.getElementById("scroll_"+id+"_scrollbar").style.display = '';
	}else{
 		document.getElementById(id+"_append").innerHTML = html;
	document.getElementById("scroll_"+id+"_scrollbar").style.display = 'none';
	}


 }*/

function redraw(objId,id, hiddenid){

	var vals = document.getElementById(hiddenid).value.toString().split("||");
	var html = "";
	var count = 0;
	var n ='';
for (var i = 0; i< vals.length; i++){
if(i==0){n='none';
 }else{n='';}
if(document.getElementById(objId).value.toLowerCase() != vals[i].toLowerCase()){
		html +="<div  style='clear: both;cursor: hand; cursor: pointer;padding-left:5px;' onmouseover=\"javascript: this.style.color = '#BE7C00';\" onmouseout=\"javascript: this.style.color = '#000000';\" onclick=\"javascript: document.getElementById('h_"+objId+"').value='"+n+"';document.getElementById('"+objId+"').value='"+vals[i]+"';hidedropdown('"+id+"');redraw('"+objId+"','"+id+"', '"+hiddenid+"');\">"+vals[i]+"</div>";
		count++;
}
		}

if(count>7){
		//document.getElementById(id).innerHTML = "<div style=\"height:116px;overflow:auto;\">"+html+"</div>";
		document.getElementById(id+"_append").innerHTML = "<div id='scroll_"+id+"'style=\"height:116px;overflow:hidden;float: left\">"+html+"</div>";
		document.getElementById(id+"_append").style.width = 	parseInt(document.getElementById(id).style.width.replace("px",""))-20+"px";
		document.getElementById("scroll_"+id+"_scrollbar").style.display = '';
		document.getElementById("scroll_"+id+"_handle").style.top = '0px';	
}else{
 		document.getElementById(id+"_append").innerHTML = html;
document.getElementById("scroll_"+id+"_scrollbar").style.display = 'none';
	}

}

 function suggestlist4NE(obj, id,scid, val){

showdropdown(id);
  	var vals = val.toString().split("||");
  	var html = "";
 	var typedtext = obj.value;
	var count = 0;
	var n = "";
 if(typedtext.length>0){
	for (var i = 0; i< vals.length; i++){
		var temp = vals[i]; 
		if(i==0){n='none'; }else{n='';}
		if(typedtext.length<=temp.length){
			var check = temp.substring(0,typedtext.length);
			if(check.toLowerCase() == typedtext.toLowerCase()){
			//html +="<div  style='clear: both;cursor: hand; cursor: pointer;padding-left:5px;' onmouseover=\"javascript: this.style.color = '#BE7C00';\" onmouseout=\"javascript: this.style.color = '#000000';\" onclick=\"javascript: document.getElementById('h_"+obj.id+"').value='"+n+"';document.getElementById('"+obj.id+"').value='"+vals[i]+"';hidedropdown('"+id+"');redraw('"+obj.id+"','"+id+"', 'val_"+obj.id+"');\">"+vals[i]+"</div>";
			document.getElementById(id+'_'+(i+1)).style.display = '';
			count++;			
			}else{
				document.getElementById(id+'_'+(i+1)).style.display = 'none';}
}}	
 }else{
	for (var i = 0; i< vals.length; i++){
		if(i==0){n='none'; }else{n='';}
		//html +="<div  style='clear: both;cursor: hand; cursor: pointer;padding-left:5px;' onmouseover=\"javascript: this.style.color = '#BE7C00';\" onmouseout=\"javascript: this.style.color = '#000000';\" onclick=\"javascript : document.getElementById('h_"+obj.id+"').value='"+n+"';document.getElementById('"+obj.id+"').value='"+vals[i]+"';hidedropdown('"+id+"');redraw('"+obj.id+"','"+id+"', 'val_"+obj.id+"');\">"+vals[i]+"</div>";
		document.getElementById(id+'_'+(i+1)).style.display = '';
		count++;
		}}

if(count>7){
		document.getElementById(id+"_append").style.width = 	parseInt(document.getElementById(id).style.width.replace("px",""))-20+"px";
		document.getElementById(scid+"_scrollbar").style.display = '';
		document.getElementById(scid+"_handle").style.top = '0px';	
		document.getElementById(scid).style.height ='116px';
}else{
 		document.getElementById(scid+"_scrollbar").style.display = 'none';
		document.getElementById(scid).style.height ='auto';
	}

 }

function redraw4NE(objId,id, hiddenid){

	var vals = document.getElementById(hiddenid).value.toString().split("||");
	var html = "";
	var count = 0;

for (var i = 0; i< vals.length; i++){

if(document.getElementById(objId).value.toLowerCase() != vals[i].toLowerCase()){
	//	html +="<div  style='clear: both;cursor: hand; cursor: pointer;padding-left:5px;' onmouseover=\"javascript: this.style.color = '#BE7C00';\" onmouseout=\"javascript: this.style.color = '#000000';\" onclick=\"javascript: document.getElementById('h_"+objId+"').value='"+n+"';document.getElementById('"+objId+"').value='"+vals[i]+"';hidedropdown('"+id+"');redraw('"+objId+"','"+id+"', '"+hiddenid+"');\">"+vals[i]+"</div>";
		
	document.getElementById(id+'_'+(i+1)).style.display = '';
	count++;
	}else{
	document.getElementById(id+'_'+(i+1)).style.display = 'none';
}}
if(count>7){
		document.getElementById(id+"_append").style.width = 	parseInt(document.getElementById(id).style.width.replace("px",""))-20+"px";
		document.getElementById(scid+"_scrollbar").style.display = '';
		document.getElementById(scid+"_handle").style.top = '0px';	
		document.getElementById(scid).style.height ='116px';
}else{
 			document.getElementById(scid+"_scrollbar").style.display = 'none';
			document.getElementById(scid).style.height ='auto';
	}
}
 
 /////Drop Down script end ////
 /////map script start////
function linkClassOnOff(id,cssSrc)
{
	document.getElementById(id).className=cssSrc;
	
}

 /////map script end ////

/////////////Newsletter Start//////////////
function checkNewsletter(param1,param2,param3,param4,param5,param6,param7,param8,param9,param10,param12,param13,param14,param15,param16,param17,param18)
{

  var flag1=false;
  var flag2=false;
  var flag3=false;
  var flag4=false;
  var flag5=false;
  var flag6=false;
  var flag7=false;
  var flag8=false;
  var flag9=false;
  var flag10=false;
  var flag12=false;
  var flag13=false;
  var flag14=false;
  var flag15=false;
  var flag16=false;
  var flag17=false;
  var flag18=false;

   var elemLabel1=param1;

   if(elemLabel1!="" && document.getElementById("address").value!=0)
      document.getElementById("formOfAddressElem").value=document.getElementById("address").options[document.getElementById("address").value].text;
   if(elemLabel1!="" && elemLabel1.indexOf("*")!=-1)
   {
       if(document.getElementById("address").value!=0)
         flag1=true;
	}
   else
       flag1=true;
   
   var elemLabel2=param2;
   if(elemLabel2!="" && elemLabel2!="" && elemLabel2.indexOf("*")!=-1)
   {
     var tStr=trimmed(document.getElementById("lastname").value);
     if(document.getElementById("lastname").value!="" && tStr!="")
       flag2=true;
   }
   else
      flag2=true;
   
   var elemLabel3=param3;
   if(elemLabel3!="" && elemLabel3.indexOf("*")!=-1)
   {
     var tStr=trimmed(document.getElementById("firstname").value);
     if(document.getElementById("firstname").value!="" && tStr!="")
       flag3=true;
   }
   else
      flag3=true;
  
  	var email1 = "";
	var email2 = "";
	try{email1 = document.getElementById("emailid").value;}catch(e){}
	try{var email2 = document.getElementById("emailidconfirm").value;}catch(e){}
	flag4=(email1.toLowerCase()==email2.toLowerCase() && validateEmail("emailid") && validateEmail("emailidconfirm"))?true:false;
  
   
   var elemLabel5=param5;
   if(elemLabel5!="" && elemLabel5.indexOf("*")!=-1)
   {
      var tStr=trimmed(document.getElementById("positionText").value);
      if(document.getElementById("positionText").value!="" && tStr!="")
        flag5=true;
   }
   else
      flag5=true;
   
   var elemLabel6=param6;
   if(elemLabel6!="" && elemLabel6.indexOf("*")!=-1)
   {
      var tStr=trimmed(document.getElementById("departmentText").value);
      if(document.getElementById("departmentText").value!="" && tStr!="")
        flag6=true;
   }
   else
      flag6=true;


 var elemLabel7=param7;
   if(elemLabel7!="" && elemLabel7.indexOf("*")!=-1)
   {
      var tStr=trimmed(document.getElementById("companyText").value);
      if(document.getElementById("companyText").value!="" && tStr!="")
        flag7=true;
   }
   else
      flag7=true;


var elemLabel8=param8;
   if(elemLabel8!="" && elemLabel8.indexOf("*")!=-1)
   {
      var tStr=trimmed(document.getElementById("streetnameText").value);
	  var tStr2=trimmed(document.getElementById("streetnoText").value);
      if(document.getElementById("streetnameText").value!="" && tStr!="" && document.getElementById("streetnoText").value!="" && tStr2!="")
        flag8=true;
   }
   else
      flag8=true;


var elemLabel9=param9;
   if(elemLabel9!="" && elemLabel9.indexOf("*")!=-1)
   {
      var tStr=trimmed(document.getElementById("cityText").value);
	  var tStr2=trimmed(document.getElementById("zipcodeText").value);
      if(document.getElementById("cityText").value!="" && tStr!="" && document.getElementById("zipcodeText").value!="" && tStr2!="")
        flag9=true;
   }
   else
      flag9=true;

var elemLabel10=param10;
   if(elemLabel10!="" && elemLabel10.indexOf("*")!=-1)
   {
      var tStr=trimmed(document.getElementById("countryText").value);
      if(document.getElementById("countryText").value!="" && tStr!="")
        flag10=true;
   }
   else
      flag10=true;



var elemLabel12=param12;
   if(elemLabel12!="" && elemLabel12.indexOf("*")!=-1)
   {
      var tStr=trimmed(document.getElementById("affirmationText").value);
      if(document.getElementById("affirmationText").value!="" && tStr!="")
        flag12=true;
   }
   else
      flag12=true;

var elemLabel13=param13;
   if(elemLabel13!="" && elemLabel13.indexOf("*")!=-1)
   {
      var tStr=trimmed(document.getElementById("accountmanagerText").value);
      if(document.getElementById("accountmanagerText").value!="" && tStr!="")
        flag13=true;
   }
   else
      flag13=true;

 var elemLabel14=param14;

   if(elemLabel14!="" && document.getElementById("study").value!=0)
      document.getElementById("studyTextBoxElem").value=document.getElementById("study").options[document.getElementById("study").value].text;
   if(elemLabel14!="" && elemLabel14.indexOf("*")!=-1)
   {
       if(document.getElementById("study").value!=0)
         flag14=true;
	}
   else
       flag14=true;
      
  
  var elemLabel15=param15;

   if(elemLabel15!="" && document.getElementById("newsletter").value!=0)
      document.getElementById("newsletterTextBoxElem").value=document.getElementById("newsletter").options[document.getElementById("newsletter").value].text;
   if(elemLabel15!="" && elemLabel15.indexOf("*")!=-1)
   {
       if(document.getElementById("newsletter").value!=0)
         flag15=true;
	}
   else
       flag15=true;

 var elemLabel16=param16;

   if(elemLabel16!="" && document.getElementById("mailing").value!=0)
      document.getElementById("mailingTextBoxElem").value=document.getElementById("mailing").options[document.getElementById("mailing").value].text;
   if(elemLabel16!="" && elemLabel16.indexOf("*")!=-1)
   {
       if(document.getElementById("mailing").value!=0)
         flag16=true;
	}
   else
       flag16=true;
  
 var elemLabel17=param17;
     
   if(elemLabel17!="" && elemLabel17.indexOf("*")!=-1)
   {
       if(document.getElementById("category").value!="")
         flag17=true;
	}
   else
       flag17=true;
    
var elemLabel18=param18;

 if(elemLabel18!="" && document.getElementById("languagebox").value!=0){
    
  document.getElementById("languageElem").value=document.getElementById("languagebox").options[document.getElementById("languagebox").value].text;
}
  
 if(elemLabel18!="" && elemLabel18.indexOf("*")!=-1)
   {

       if(document.getElementById("languagebox").value!=0)
         flag18=true;
	}
   else{
       flag18=true;
document.getElementById("languageElem").value="";
}

   
   if(flag1 && flag2 && flag3 && flag4 && flag5 && flag6 && flag7 && flag8 && flag9 && flag10 && flag12 && flag13 && flag14 && flag15 && flag16 && flag17 && flag18)
    { 
      document.newsletterform.submit();
    }
   
 
 
     var flags=new Array(flag1,flag2,flag3,flag4,flag5,flag6,flag7,flag8,flag9,flag10,flag12,flag13,flag14,flag15,flag16,flag17,flag18);
  for(var s=0;s<flags.length;s++)
  {
     if(flags[s]==false)
     {
       switch(s)
       {
       case 0: try{document.getElementById("formaddresserror").style.display="";}catch(e){}
                      break;
       case 1: try{document.getElementById("lastnameerror").style.display="";}catch(e){}
                      break;
       case 2: try{document.getElementById("firstnameerror").style.display="";}catch(e){}
                      break;
       case 3: try{document.getElementById("emailerror").style.display="";}catch(e){}
                      break;
       case 4: try{document.getElementById("positionErrorText").style.display="";}catch(e){}
                      break;
       case 5: try{document.getElementById("departmentErrorText").style.display="";}catch(e){}
                      break;
       case 6: try{document.getElementById("companyErrorText").style.display="";}catch(e){}
                      break;
       case 7: try{document.getElementById("streetErrorText").style.display="";}catch(e){}
                      break;
       case 8: try{document.getElementById("cityErrorText").style.display="";}catch(e){}
                      break;
       case 9: try{document.getElementById("countryErrorText").style.display="";}catch(e){}
                      break;
       case 10:try{document.getElementById("zipcodeErrorText").style.display="";}catch(e){}
                      break;
       case 11:try{document.getElementById("accountmanagerErrorText").style.display="";}catch(e){}
                      break;
       case 12:try{document.getElementById("studyError").style.display="";}catch(e){}
                      break;
       case 13:try{document.getElementById("newsletterError").style.display="";}catch(e){}
                      break;
       case 14:try{document.getElementById("mailingError").style.display="";}catch(e){}
                      break;
       case 15:try{document.getElementById("categoryError").style.display="";}catch(e){}
                      break;
       case 16:try{document.getElementById("languageError").style.display="";}catch(e){}
                      break;
       }
     }
     else{
     switch(s)
       {
       case 0: try{document.getElementById("formaddresserror").style.display="none";}catch(e){}
                      break;
       case 1: try{document.getElementById("lastnameerror").style.display="none";}catch(e){}
                      break;
       case 2: try{document.getElementById("firstnameerror").style.display="none";}catch(e){}
                      break;
       case 3: try{document.getElementById("emailerror").style.display="none";}catch(e){}
                      break;
       case 4: try{document.getElementById("positionErrorText").style.display="none";}catch(e){}
                      break;
       case 5: try{document.getElementById("departmentErrorText").style.display="none";}catch(e){}
                      break;
       case 6: try{document.getElementById("companyErrorText").style.display="none";}catch(e){}
                      break;
       case 7: try{document.getElementById("streetErrorText").style.display="none";}catch(e){}
                      break;
       case 8: try{document.getElementById("cityErrorText").style.display="none";}catch(e){}
                      break;
       case 9: try{document.getElementById("countryErrorText").style.display="none";}catch(e){}
                      break;
       case 10:try{document.getElementById("zipcodeErrorText").style.display="none";}catch(e){}
                      break;
       case 11:try{document.getElementById("accountmanagerErrorText").style.display="none";}catch(e){}
                      break;
       case 12:try{document.getElementById("studyError").style.display="none";}catch(e){}
                      break;
       case 13:try{document.getElementById("newsletterError").style.display="none";}catch(e){}
                      break;
       case 14:try{document.getElementById("mailingError").style.display="none";}catch(e){}
                      break;
       case 15:try{document.getElementById("categoryError").style.display="none";}catch(e){}
                      break;
       case 16:try{document.getElementById("languageError").style.display="none";}catch(e){}
                      break;

       }
     
     }
     
     
   }

    



}

function checkEmailcomp(param1,param2,param3,param4,param5,param6)
{

  var flag1=false;
  var flag2=false;
  var flag3=false;
  var flag4=false;
  var flag5=false;
  var flag6=false;
  var flag7=false;
  

   var elemLabel1=param1;
   if(document.getElementById("address").value!=0)
      document.getElementById("formOfAddressElem").value=document.getElementById("address").options[document.getElementById("address").value].text;
   if(elemLabel1.indexOf("*")!=-1)
   {
       if(document.getElementById("address").value!=0)
         flag1=true;
	}
   else
       flag1=true;
      
   var elemLabel2=param2;
   if(elemLabel2.indexOf("*")!=-1)
   {
     var tStr=trimmed(document.getElementById("lastname").value);
     if(document.getElementById("lastname").value!="" && tStr!="")
       flag2=true;
   }
   else
      flag2=true;
   
   var elemLabel3=param3;
   if(elemLabel3.indexOf("*")!=-1)
   {
     var tStr=trimmed(document.getElementById("firstname").value);
     if(document.getElementById("firstname").value!="" && tStr!="")
       flag3=true;
   }
   else
      flag3=true;
  
  
  flag4=validateEmail("emailtext");
  
   
   var elemLabel5=param4;
   if(elemLabel5.indexOf("*")!=-1)
   {
      var tStr=trimmed(document.getElementById("skillsText").value);
      if(document.getElementById("skillsText").value!="" && tStr!="")
        flag5=true;
   }
   else
      flag5=true;
   
  
  var elemLabel6=param5;
  if(elemLabel6.indexOf("*")!=-1)
  {
    var r1=document.getElementsByName("frequencyText");
    for(var i=0; i<r1.length; i++)
    {
      if(r1[i].checked==true){
        flag6=true; 
        document.getElementById("frequencyTextBoxElem").value=r1[i].value;
      }
    }
  }
  else{
      flag6=true;
	var r1=document.getElementsByName("frequencyText");
    for(var i=0; i<r1.length; i++)
    {
      if(r1[i].checked==true)
             document.getElementById("frequencyTextBoxElem").value=r1[i].value;
    }      
  }
      
      
   var elemLabel7=param6;
   if(elemLabel7.indexOf("*")!=-1)
    {
      var r1=document.getElementsByName("emailFormatText");
      for(var i=0; i<r1.length; i++)
      {  
	       if(r1[i].checked==true){
           flag7=true; 
		   document.getElementById("emailFormatTextBoxElem").value=r1[i].value;	
         }
      }
    }
   else{
      flag7=true;
	  var r1=document.getElementsByName("emailFormatText");
      for(var i=0; i<r1.length; i++)
      {
         if(r1[i].checked==true)
		   document.getElementById("emailFormatTextBoxElem").value=r1[i].value;	
      }
   }
  
   
   if(flag1 && flag2 && flag3 && flag4 && flag5 && flag6 && flag7)
    { 
       
      document.jobdetailform.submit();
    }
   
 
 
     var flags=new Array(flag1,flag2,flag3,flag4,flag5,flag6,flag7);
  for(var s=0;s<flags.length;s++)
  {
     if(flags[s]==false)
     {
       switch(s)
       {
       case 0: document.getElementById("formaddresserror").style.display="";
                      break;
       case 1: document.getElementById("lastnameerror").style.display="";
                      break;
       case 2: document.getElementById("firstnameerror").style.display="";
                      break;
       case 3: document.getElementById("emailerror").style.display="";
                      break;
       case 4: document.getElementById("skillsErrorText").style.display="";
                      break;
       case 5: document.getElementById("frequencyerror").style.display="";
                      break;
       case 6: document.getElementById("emailformatErrorText").style.display="";
                      break;
       }
     }
     else{
     switch(s)
       {
       case 0: document.getElementById("formaddresserror").style.display="none";
                      break;
       case 1: document.getElementById("lastnameerror").style.display="none";
                      break;
       case 2: document.getElementById("firstnameerror").style.display="none";
                      break;
       case 3: document.getElementById("emailerror").style.display="none";
                      break;
       case 4: document.getElementById("skillsErrorText").style.display="none";
                      break;
       case 5: document.getElementById("frequencyerror").style.display="none";
                      break;
       case 6: document.getElementById("emailformatErrorText").style.display="none";
                      break;
       }
     
     }
     
     
   }

    

}

function trimmed(jcontactbox) {
var Str=jcontactbox;
var Counter=0;
for(var i=0;i<Str.length;i++){
if(Str.charAt(i)==" ")
 Counter++;
}
if (Counter==Str.length) {
return "";
}
else { 
return Str;
}
}

function selectSubDrop(objName){
try{document.getElementsByName("subTxt_"+objName)[0].style.display="none";}catch(ste){}
document.getElementsByName(objName)[0].value="";
var c_obj = document.getElementsByName("par_"+objName)[0];
for(var i=0; i<c_obj.options.length; i++)
{
try{
document.getElementsByName("sub_"+objName+"_"+i)[0].style.display="none";
}catch(e){}
}
for(var i=0; i<c_obj.options.length; i++)
{
if(c_obj.options[i].selected){
try{
var c_text= c_obj.options[i].value;
c_text = (c_text.indexOf("[")!=-1)?c_text.substring(0,c_text.indexOf("[")):c_text;
document.getElementsByName(objName)[0].value = c_text;
document.getElementsByName("sub_"+objName+"_"+i)[0].style.display="";
}catch(e){}
}
}
}

function setSubDropValue(objName,dropObj){
try{document.getElementsByName("subTxt_"+objName)[0].style.display="none";}catch(ste){}
var s_obj = document.getElementsByName(dropObj)[0];
try{
for(var i=0; i<s_obj.options.length; i++)
{
if(s_obj.options[i].selected && i==0){
try{
var parCVal = document.getElementsByName(objName)[0].value;
if(parCVal.indexOf(" > ")!=-1){
parCVal = parCVal.substring(0,parCVal.indexOf(" > "));
}
document.getElementsByName(objName)[0].value = "";
document.getElementsByName(objName)[0].value = parCVal;
}catch(e){}
}
else if(s_obj.options[i].selected){
try{
var parCVal = document.getElementsByName(objName)[0].value;
if(parCVal.indexOf(" > ")!=-1){
parCVal = parCVal.substring(0,parCVal.indexOf(" > "));
}
document.getElementsByName(objName)[0].value = "";
var seo=s_obj.options[i].value
var optVal = (seo.indexOf("{")!=-1)?seo.substring((seo.indexOf("{")+1),seo.indexOf("}")):seo;
document.getElementsByName(objName)[0].value = parCVal+" > "+optVal;
if(seo.indexOf("{")!=-1){
try{document.getElementsByName("subTxt_"+objName)[0].style.display="";}catch(ste){}
}
try{document.getElementsByName("subTxt_"+objName+"_"+i)[0].style.display="";}catch(sube){}
}catch(e){}
}
}
}
catch(et){
try{
var parCVal = document.getElementsByName(objName)[0].value;
if(parCVal.indexOf(" > ")!=-1){
parCVal = parCVal.substring(0,parCVal.indexOf(" > "));
}
document.getElementsByName(objName)[0].value = "";
var c_obj = document.getElementsByName("par_"+objName)[0];
for(var i=0; i<c_obj.options.length; i++)
{
try{
if(c_obj.options[i].selected && document.getElementsByName("sub_"+objName+"_"+i)[0].style.display=="")
document.getElementsByName(objName)[0].value = parCVal+" > "+document.getElementsByName("sub_"+objName+"_"+i)[0].value;
}catch(e){}
}
}catch(e){}
}
}

function setSubDropTxtValue(objName){
try{
var parCVal = document.getElementsByName(objName)[0].value;
if(parCVal.indexOf(": ")!=-1){
parCVal = parCVal.substring(0,parCVal.indexOf(": "));
}
document.getElementsByName(objName)[0].value = "";

try{
document.getElementsByName(objName)[0].value = parCVal+": "+document.getElementsByName("subTxt_"+objName)[0].value;
}catch(e){}

}catch(e){}
}

function get09FilterListDef(){
document.getElementById('refBoolean').value='true'; 
document.getElementById('result').value='null'; 
document.getElementById('ptlink').value='1'; 
document.getElementById('ptcurrent').value='1'; 
document.f1.submit();
}

function gftcfc_init(){
  htmlloadflag = true;
  try{
	if(formprintswitch!=""){
	document.getElementById("printtxt").href= "javascript:openFormPrintPreview(formprintswitch);";
	document.getElementById("printpreview09").onclick= function(){
		openFormPrintPreview(formprintswitch);
	};
	}
	}catch(e){}
}


