var homeMenuTimer;
var menuinterVal;
var tabNavTimer;
var sitemapTimer;
var spl3tTimer;
var myinvoiceTimer;
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 ="";
var menuHeight="0px";
var menuHighImage="";
var menuNormalImage="";
var mouseOnMenuFlag=false;
var hideMenuTimer;
var lastWhiteLineColor="";
var menu5Count_10=0;
var pipeLargeTimer;

var topnav10_flag="n";
var country10_flag="n";
var language10_flag="n";
var sb10_flag="n";

var both_pipe_yes = "[y|y|y|y][y|n|y|y][y|y|n|y]";
var left_pipe_yes = "[y|y|n|n][y|y|y|n][y|n|y|n]";
var right_pipe_yes = "[n|y|y|y][n|n|y|y][y|n|n|y][n|y|n|y]";

var homeBannerImageSrc = "";

var ie55_png = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1);
var ie6_png = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);

function getXMLObject()  //XML OBJECT
{
   var xmlHttp = false;
   try {
     xmlHttp = new ActiveXObject("Msxml2.XMLHTTP")  // For Old Microsoft Browsers
   }
   catch (e) {
     try {
       xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")  // For Microsoft IE 6.0+
     }
     catch (e2) {
       xmlHttp = false   // No Browser accepts the XMLHTTP Object then false
     }
   }
   if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
     xmlHttp = new XMLHttpRequest();        //For Mozilla, Opera Browsers
   }
   return xmlHttp;  // Mandatory Statement returning the ajax object created
}

function applyHomeImageLinkStyleJS(){
try{
applyHomeImageLinkStyleJS();
}catch(e){}
}

function showLargePipe(){
pipeLargeTimer = setTimeout("alignLargePipe()",100);
}

function alignLargePipe(){
try{
var showPipes10_flag="["+topnav10_flag+"|"+country10_flag+"|"+language10_flag+"|"+sb10_flag+"]";
if (both_pipe_yes.lastIndexOf(showPipes10_flag) != -1){
document.getElementById("leftCLSPipe").style.display="";
document.getElementById("rightCLSPipe").style.display="";
} else if (left_pipe_yes.lastIndexOf(showPipes10_flag) != -1){
document.getElementById("leftCLSPipe").style.display="";
document.getElementById("rightCLSPipe").style.display="none";
} else if (right_pipe_yes.lastIndexOf(showPipes10_flag) != -1){
document.getElementById("leftCLSPipe").style.display="none";
document.getElementById("rightCLSPipe").style.display="";
}
clearTimeout(pipeLargeTimer);
}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>127)?document.getElementById("rowDivDown2").clientHeight:127;
document.getElementById("rowDivDown2").style.display="none";
var leftForBGDiv=1;
for(var i=1;i<=4;i++)
{
var topCellWidth=document.getElementById("cellt"+i).clientWidth;
var bottomCellWidth=document.getElementById("dcellb"+i).clientWidth;
var actWidth=(topCellWidth>bottomCellWidth)?topCellWidth:bottomCellWidth;
actWidth = (actWidth>160)?actWidth:160;
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("dcellb"+i+j).style.width=actWidth+"px"; } catch(e){}
}
try{ document.getElementById("cellb"+i).style.height=adoptedMenuHeight+"px"; } catch(e){}
try{ document.getElementById("dcellb"+i).style.height=adoptedMenuHeight+"px"; } catch(e){}
try{ document.getElementById("dbgcellb"+i).style.width=actWidth+"px"; } catch(e){}
try{ document.getElementById("dbgcellb"+i).style.height=adoptedMenuHeight+"px"; } catch(e){}
try{ document.getElementById("dbgcellb"+i).style.left=leftForBGDiv+"px"; } catch(e){alert(e);}
leftForBGDiv = leftForBGDiv+actWidth+1;
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";
clearTimeout(homeMenuTimer);
}catch(e){}
}

function align5MenuWidth(){
try{
var availableTopicCount=0;
var adoptedMenuWidth=0;
var adoptedMenuHeight=(document.getElementById("rowDivDown2").clientHeight>127)?document.getElementById("rowDivDown2").clientHeight:127;
document.getElementById("rowDivDown2").style.display="none";
var leftForBGDiv=1;
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";
availableTopicCount=i;
for(var j=1; j<=7; j++){
	try{ document.getElementById("cellb"+i+j).style.width=actWidth+"px"; } catch(e){}	
	try{ document.getElementById("dcellb"+i+j).style.width=actWidth+"px"; } catch(e){}	
}
try{ document.getElementById("cellb"+i).style.height=adoptedMenuHeight+"px"; } catch(e){}
try{ document.getElementById("dcellb"+i).style.height=adoptedMenuHeight+"px"; } catch(e){}
try{ document.getElementById("dbgcellb"+i).style.width=actWidth+"px"; } catch(e){}
try{ document.getElementById("dbgcellb"+i).style.height=adoptedMenuHeight+"px"; } catch(e){}
try{ document.getElementById("dbgcellb"+i).style.left=leftForBGDiv+"px"; } catch(e){alert(e);}
leftForBGDiv = leftForBGDiv+actWidth+1;
try{ document.getElementById("bspac"+i).style.height=adoptedMenuHeight+"px"; } catch(e){}
}
try{document.getElementById("bspaclast").style.height=adoptedMenuHeight+"px"; } catch(e){}
menuHeight=adoptedMenuHeight+"px";
document.getElementById("rowDivTop").style.visibility="visible";
try{
	lastWhiteLineColor = document.getElementById("bspaclast").style.backgroundColor;
}catch(e){}
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(id.charAt(5));
	}
}
	
function hilightMenu(id)
{
	if(document.getElementById(id).childNodes[0].innerHTML==null || document.getElementById(id).childNodes[0].innerHTML=="")
	{
	document.getElementById(id).style.backgroundColor='';
	}
	else
	{
	showsubmenu(id.substring(5,id.length));
	var topAnchorid = "anchorb"+id.substring(5,id.length);
	document.getElementById(topAnchorid).className="topNavLevelOver";
	}
}
	
function lowlightMenu(id)
{
	try{	
	var topAnchorid = "anchorb"+id.substring(5,id.length);
	document.getElementById(topAnchorid).className="topNavLevel";
	}catch(e){}
}

function ohilightMenuAct(id)
{
	if(document.getElementById(id).childNodes[0].innerHTML==null || document.getElementById(id).childNodes[0].innerHTML=="")
	{
	document.getElementById(id).style.backgroundColor='';
	}
	else
	{
	showsubmenu(id.charAt(7));
	}
}
	
function enablePipes()
{
		for(var i=1;i<5;i++){
			if(i<=menu5Count_10){		
				try{document.getElementById("tspac"+i).style.backgroundColor="#FFFFFF";}catch(e){}			
			}
		}		
}
	
function disablePipes()
{
		for(var i=1;i<5;i++){		
			if(i<=menu5Count_10){		
				try{document.getElementById("tspac"+i).style.backgroundColor="";}catch(e){}			
			}
		}			
}


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()
{
		if(!mouseOnMenuFlag){
		for(var i=1;i<=5;i++)
		{
				try{document.getElementById("cellb"+i).style.display="none";}catch(e){}
				try{document.getElementById("dbgcellb"+i).style.display="none";}catch(e){}
		}
		document.getElementById("rowDivDown").style.display="none";
		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("bspaclast").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){}
		try{document.getElementById("width1white").style.height="0px";}catch(e){}
		clearTimeout(hideMenuTimer);
		}
}

function showsubmenu(id)
{
		for(var i=1;i<=5;i++)
		{
			try{document.getElementById("dbgcellb"+i).style.display="none";}catch(e){}
			try{document.getElementById("cellb"+i).style.display="";}catch(e){}
		}
		try{document.getElementById("dbgcellb"+id).style.display="";}catch(e){}
}


function enableSubMenuAct(id,eFlag)
{
	try{
	if(navigator.userAgent.toLowerCase().indexOf('msie 6') != -1)
		document.getElementById("corptextandmenu").style.overflow="hidden";
	}catch(e){}
	clearTimeout(hideMenuTimer);
	mouseOnMenuFlag=true;
	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(id.charAt(5));
	document.getElementById("rowDivDown").style.display="";
	if(eFlag)document.getElementById(topAnchorid).className="topNavLevelAct";
	for(var i=1;i<5;i++){
		if(i<=menu5Count_10){
			try{document.getElementById("tspac"+i).style.backgroundColor="#FFFFFF";}catch(e){}
			try{document.getElementById("bspac"+i).style.backgroundColor="#FFFFFF";}catch(e){}
			try{document.getElementById("bspac"+i+"_ro").style.display="none";}catch(e){}
			try{document.getElementById("bspac"+i+"_no").style.display="";}catch(e){}
		}else{
			try{document.getElementById("tspac"+i).style.backgroundColor="";}catch(e){}
			try{document.getElementById("bspac"+i).style.backgroundColor="";}catch(e){}
			try{document.getElementById("bspac"+i+"_no").style.display="none";}catch(e){}
			try{document.getElementById("bspac"+i+"_ro").style.display="";}catch(e){}
		}
	}
	if(menu5Count_10<5){
		try{document.getElementById("bspaclast").style.backgroundColor="";}catch(e){}
		try{document.getElementById("bspac_lno").style.display="none";}catch(e){}
		try{document.getElementById("bspac_lro").style.display="";}catch(e){}
		try{document.getElementById("bspac_lro").style.top="0px";}catch(e){}
	}else{
		try{document.getElementById("bspaclast").style.backgroundColor=lastWhiteLineColor;}catch(e){}
		try{document.getElementById("bspac_lro").style.display="none";}catch(e){}
		try{document.getElementById("bspac_lno").style.display="";}catch(e){}
		try{document.getElementById("bspac_lno").style.top="0px";}catch(e){}
	}
	try{document.getElementById("width1white").style.height=menuHeight;}catch(e){}

}
}

function enableSubMenu(id,eFlag)
{
	try{
	if(navigator.userAgent.toLowerCase().indexOf('msie 6') != -1)
		document.getElementById("corptextandmenu").style.overflow="hidden";
	}catch(e){}
	clearTimeout(hideMenuTimer);
	mouseOnMenuFlag=true;
	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);
	if(document.getElementById(topMenuid).childNodes[0].innerHTML != null && document.getElementById(topMenuid).childNodes[0].innerHTML !="" )
	{
	showsubmenu(id.charAt(5));
	document.getElementById("rowDivDown").style.display="";
			
		if(eFlag)document.getElementById(topMenuid).style.backgroundColor='#D8DDE3';
		if(eFlag)document.getElementById(topAnchorid).className="topNavLevelOver";

	for(var i=1;i<5;i++){
		if(i<=menu5Count_10){
			try{document.getElementById("tspac"+i).style.backgroundColor="#FFFFFF";}catch(e){}
			try{document.getElementById("bspac"+i).style.backgroundColor="#FFFFFF";}catch(e){}
			try{document.getElementById("bspac"+i+"_ro").style.display="none";}catch(e){}
			try{document.getElementById("bspac"+i+"_no").style.display="";}catch(e){}
		}else{
			try{document.getElementById("tspac"+i).style.backgroundColor="";}catch(e){}
			try{document.getElementById("bspac"+i).style.backgroundColor="";}catch(e){}
			try{document.getElementById("bspac"+i+"_no").style.display="none";}catch(e){}
			try{document.getElementById("bspac"+i+"_ro").style.display="";}catch(e){}
		}
		
	}
	if(menu5Count_10<5){
		try{document.getElementById("bspaclast").style.backgroundColor="";}catch(e){}
		try{document.getElementById("bspac_lno").style.display="none";}catch(e){}
		try{document.getElementById("bspac_lro").style.display="";}catch(e){}
		try{document.getElementById("bspac_lro").style.top="0px";}catch(e){}
	}else{
		try{document.getElementById("bspaclast").style.backgroundColor=lastWhiteLineColor;}catch(e){}
		try{document.getElementById("bspac_lro").style.display="none";}catch(e){}
		try{document.getElementById("bspac_lno").style.display="";}catch(e){}
		try{document.getElementById("bspac_lno").style.top="0px";}catch(e){}
	}
	
	try{document.getElementById("width1white").style.height=menuHeight;}catch(e){}
	
}

}

function disableSubMenu(id,eFlag)

	{
		clearTimeout(hideMenuTimer);	
		try{document.getElementById("mshadow1").style.display="none";}catch(e){}
		try{document.getElementById("nomshadow1").style.display="";}catch(e){}
		try{document.getElementById("mshadow2").style.display="none";}catch(e){}
		try{document.getElementById("nomshadow2").style.display="";}catch(e){}
		try{document.getElementById("mshadow3").style.display="none";}catch(e){}
		try{document.getElementById("nomshadow3").style.display="";}catch(e){}
		try{document.getElementById("mshadow4").style.display="none";}catch(e){}
		try{document.getElementById("nomshadow4").style.display="";}catch(e){}
		try{document.getElementById("mshadow5").style.display="none";}catch(e){}
		try{document.getElementById("nomshadow5").style.display="";}catch(e){}
		try{document.getElementById("mshadowc1").style.display="none";}catch(e){}
		try{document.getElementById("mshadowc2").style.display="none";}catch(e){}
		try{document.getElementById("mshadowc3").style.display="none";}catch(e){}
		try{document.getElementById("mshadowc4").style.display="none";}catch(e){}
		try{document.getElementById("mshadowc5").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 !="" )
	{
		if(eFlag)document.getElementById(topMenuid).style.backgroundColor='';
		if(eFlag){
		if(document.getElementById(topAnchorid).className!="topNavLevelAct")
			document.getElementById(topAnchorid).className="topNavLevel";
		}
		
			
	}
		
	
		hideMenuTimer = setTimeout("hidesubmenu()",100);
mouseOnMenuFlag=false;

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

///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 dd_width = document.getElementById('DDme').clientWidth;
var ca_width = document.getElementById('countryanchor').clientWidth;
var diff_width=(dd_width>ca_width)?(dd_width-ca_width):(ca_width-dd_width);
var y = getXY( document.getElementById('countryanchor') ).y;
document.getElementById("DDme").style.top = y-(parseInt(offsetval))+2+"px";
document.getElementById("DDme").style.left = x-diff_width+1+"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;
}

function trim(totrim){
return totrim.replace(/^\s*(.*)/, "$1").replace(/(.*?)\s*$/, "$1");
}

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};
}

function getStyle(obj, styleProp)
{
  if (obj.currentStyle)
    return obj.currentStyle[styleProp];
  else if (window.getComputedStyle)
    return document.defaultView.getComputedStyle(obj,null).getPropertyValue(styleProp);
}



function backGroundOn(divId,bgImg){

}

function backGroundOff(divId){
document.getElementById(divId).style.backgroundImage="url('')";
}
function backGroundOffInterval(divId){
}

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);

}





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;




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

function setGoogleAnalytics4MediaLib(gaVer4MediaLib,mediaPath){
try{
	if(gaVer4MediaLib=="0"){
		pageTracker._trackPageview(mediaPath);
	}
	else if(gaVer4MediaLib=="1"){
		_gat._anonymizeIp();
		pageTracker._trackPageview(mediaPath)
	}
	else if(gaVer4MediaLib=="2"){
		_gaq.push (['_gat._anonymizeIp']); 
		_gaq.push(['_trackPageview', mediaPath]);
	}
}catch(e){  }

}



function showFLComp(elemSId,elemHId){
try{
document.getElementById(elemHId).style.display="none";
document.getElementById(elemSId).style.display="";
}catch(e){}
}

function fl11DynamicLinkOn(){
	try{
	homeMenuAniOpenFlag = false;
	document.getElementById("corptextandmenu").onclick=function(){ 
	if(homeMenuAniOpenInNew) window.open(homeMenuAniLink);	
	else document.location.href=homeMenuAniLink;	
	};
	document.getElementById("corptextandmenu").title=homeMenuAniTitle;
	document.getElementById("gftmainmenu").title=homeMenuAniTitle;
	}catch(e){}
}

function fl11DynamicLinkOff(){
	try{
    homeMenuAniOpenFlag = true;
	document.getElementById("corptextandmenu").onclick=function(){ 
		void(0);					
	};	
	}catch(e){}
}

function overThumbnail(elemIndex){
try{
if(elemIndex!=aniPlayer){
document.getElementById("aniImg"+elemIndex).style.display="none";
document.getElementById("aniImgHigh"+elemIndex).style.display="";
document.getElementById("aniImgHigh"+elemIndex).style.display="inline-block";
}
}catch(e){}
}

function outThumbnail(elemIndex){
try{
if(elemIndex!=aniPlayer){
document.getElementById("aniImgHigh"+elemIndex).style.display="none";
document.getElementById("aniImg"+elemIndex).style.display="";
document.getElementById("aniImg"+elemIndex).style.display="inline-block";
}
}catch(e){}
}

function callFaceLiftImgCheck(){
imgCheckTimer = setInterval("loadFaceLift2011Animation()",100);
}

function enableAniPNGInIE6(){ 
//enablePNGInIE6();
//enablePNGInIE6Of("gftfooterfull","footerPng");
try{
			var aniImgSrc = document.getElementById("aniTextImg_default").src;
			var aniImgObj = document.getElementById("aniTextImg_default");
			var aniImgDivObj = document.getElementById("aniTextImgDiv_default");
			aniImgObj.style.display="none";
			aniImgDivObj.style.width=$("#aniTextImg_default").width()+"px";
			aniImgDivObj.style.height=$("#aniTextImg_default").height()+"px";
			aniImgDivObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='"+aniImgSrc+"')";

 
}catch(e){}
for(var i=1;i<=3;i++){
	for(var j=1;j<=2;j++){
		try{
			var aniImgSrc = document.getElementById("ani"+i+"TextImg"+j).src;
			var aniImgObj = document.getElementById("ani"+i+"TextImg"+j);
			var aniImgDivObj = document.getElementById("ani"+i+"TextImgDiv"+j);
			aniImgObj.style.display="none";
			aniImgDivObj.style.width=$("#ani"+i+"TextImg"+j).width()+"px";
			aniImgDivObj.style.height=$("#ani"+i+"TextImg"+j).height()+"px";
			aniImgDivObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='"+aniImgSrc+"')";

 
		}catch(e){}
	}
}
}

function enablePNGInIE6(){ 
	var aniImgDivObj = document.getElementById("rowDivTop");
	var bgImage = aniImgDivObj.style.backgroundImage;
	if(bgImage != null && bgImage.toLowerCase().indexOf(".png")!=-1){
	var imageSrc = bgImage.substring((bgImage.indexOf("url(")+4),(bgImage.indexOf(".png")+4));
	aniImgDivObj.style.background = "none";
	aniImgDivObj.style.backgroundImage = "none";
	aniImgDivObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='"+imageSrc+"')";
	}
}

function enablePNGInIE6Of(id,preName){ 
	var aniImgDivParObj = document.getElementById(id);
	var pngDivObj = aniImgDivParObj.getElementsByTagName("DIV");
	for(var i=0; i<pngDivObj.length;i++){
		if(pngDivObj[i].name=="footerPngDiv"){
			var bgImage = pngDivObj[i].style.backgroundImage;
			if(bgImage != null && bgImage.toLowerCase().indexOf(".png")!=-1){
				var imageSrc = bgImage.substring((bgImage.indexOf("url(")+4),(bgImage.indexOf(".png")+4));
				pngDivObj[i].style.background = "none";
				pngDivObj[i].style.backgroundImage = "none";
				pngDivObj[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='"+imageSrc+"')";
			}
		}
	}
}

function enablePNGInIE6With(id,imageSrc){ 
	var aniImgDivObj = document.getElementById(id);
	try{aniImgDivObj.style.background = "none";}catch(e){}
	try{aniImgDivObj.style.backgroundImage = "none";}catch(e){}
	try{aniImgDivObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='"+imageSrc+"')";}catch(e){}
}

function tab11Toggle(id,classValue){
document.getElementById(id).className = classValue;
}

function tab11Click(tabid,id,elemNum){
for(var i=1; i<=5; i++){
try{
document.getElementById(id+i).style.display="none";
document.getElementById(tabid+i).className = "home11Tab";
document.getElementById(tabid+i).onmouseover = function(){
this.className = "home11TabHover";
};
document.getElementById(tabid+i).onmouseout = function(){
this.className = "home11Tab";
};
}catch(e){}
}
document.getElementById(id+elemNum).style.visibility="visible";
document.getElementById(id+elemNum).style.display="";
document.getElementById(id+elemNum).style.display="inline-block";
document.getElementById(tabid+elemNum).className = "home11TabHover";
document.getElementById(tabid+elemNum).onmouseover = function(){
this.className = "home11TabHover";
};
document.getElementById(tabid+elemNum).onmouseout = function(){
this.className = "home11TabHover";
};
}

function fontColorToggle(id,colorVal)
{
document.getElementById(id).style.color = colorVal;
}

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;
}

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='#5a7c97';
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 sendInternalLink(formName)
{
document.getElementsByName(formName)[0].submit();
}
