//Check Image Path

if(pageName== 'index' || pageName=="contactus" || pageName=="privacy"){
	path = '';
}
else{
	path = '../';
}
 
//************************************************************************//
//Open a Link

function goUrl(url, pgName){
	var redirectTo;
	if(url == '' && (pageName == 'index' || pageName=="contactus" || pageName=="privacy")) {
		redirectTo = pgName;
		window.location.href = redirectTo;
	} else if(url == '' && pageName != 'index') {	
		redirectTo = '../' + pgName;
		window.location.href = redirectTo;
	} else if(pageName == 'index' || pageName=="contactus" || pageName=="privacy") {	
		redirectTo = url + '/' + pgName;
		window.location.href = redirectTo;
	} else if(pageName!=url){
		redirectTo = '../' + url + '/' + pgName;	
		window.location.href = redirectTo;
	} else {
		redirectTo = pgName;
		window.location.href = redirectTo;
	}
}

//************************************************************************//
//Preload Images

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

MM_preloadImages('images/buttons/home_on.gif','images/buttons/aboutus_on.gif','images/buttons/industries_on.gif',
				 'images/buttons/services_on.gif','images/buttons/products_on.gif','images/buttons/customers_on.gif',
				 'images/buttons/partners_on.gif','images/buttons/resources_on.gif','images/buttons/news_on.gif',
				 'images/buttons/careers_on.gif','images/buttons/contactus_on.gif');

//************************************************************************//
//Swap Images

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//************************************************************************//
// RollOver Color Change

function MM_Colorlnav(imgid,o1,o2,b){
	obj1 = document.getElementById(o1);
	obj2 = document.getElementById(o2);
	if(b==1){
		obj1.style.backgroundColor = "#F44903";
		obj2.style.backgroundColor = "#F44903";
		obj2.style.color = "#FFFFFF";
		obj2.style.fontWeight = "bold";
		obj1.style.cursor = "pointer";
		obj2.style.cursor = "pointer";
		if(pageName == "sitemap")
			MM_swapImage(imgid,"","../images/bullete_on.gif",1);
		else
			MM_swapImage(imgid,"","../images/bullete_on.gif",1);
	}
	else{
		obj1.style.backgroundColor = "#F9F8F6";
		obj2.style.backgroundColor = "#F9F8F6";
		obj2.style.color = "#333333";
		obj2.style.fontWeight = "normal";
		obj1.style.cursor = "auto";
		obj2.style.cursor = "auto";
		MM_swapImgRestore();
	}
}

function MM_ColorSubNav(o1,o2,b){
	obj1 = document.getElementById(o1);
	obj2 = document.getElementById(o2);
	if(b==1){
		obj1.style.backgroundColor = "#F44903";
		obj1.style.color = "#FFFFFF";
		obj2.style.backgroundColor = "#F44903";
		obj2.style.color = "#FFFFFF";
		obj2.style.fontWeight = "bold";
		obj1.style.cursor = "pointer";
		obj2.style.cursor = "pointer";
	}
	else{
		obj1.style.backgroundColor = "#ffffff";
		obj1.style.color = "#333333";
		obj2.style.backgroundColor = "#ffffff";
		obj2.style.color = "#333333";
		obj2.style.fontWeight = "normal";
		obj1.style.cursor = "auto";
		obj2.style.cursor = "auto";
	}
}

function MM_ColorTit(o,b){
	if(b==1){
		o.style.backgroundColor = "#F44903";
		o.style.color = "#FFFFFF";
		o.style.cursor = "pointer";
	}else {
		o.style.backgroundColor = "#F7F5F2";
		o.style.color = "#333333";
		o.style.cursor = "auto";
	}
}

/* ----------------------------- */

function openLink(url){
	window.location.href = url;
}

function OFWindow(FileID){
	// alert(FileID);
	if(FileID.toLowerCase().indexOf(".htm")!=-1){
		//	alert(1);
		window.location.href= FileID;
	}
	else{
		var FileIDWindowName = FileID.replace(/\./,"");
		FileIDWindowName = FileIDWindowName.replace(/\//,"");
		window.open('/User/GetFile.aspx?FileID=' + FileID,'FileWindow'+FileIDWindowName,'toolbars=no,maximize=yes,resizable=yes,location=no,directories=no,scrollbars=yes,width=700,height=580,left=' + (screen.availWidth - 700)/2 + ',top=' + (screen.availHeight - 580)/2); 
	}
}
function Open3DLink(Path){
	window.open('/User/GetFile.aspx?FileID=creatives@synechron/' + Path,'FileWindowForTD','toolbars=no,maximize=yes,resizable=yes,location=no,directories=no,scrollbars=yes,width=700,height=580,left=' + (screen.availWidth - 700)/2 + ',top=' + (screen.availHeight - 580)/2); 
}

/* Function to open the brand identity sites*/


function openWin(){
	var w = 706;
	var h = 432;
	if(navigator.userAgent.indexOf('Netscape')==-1)
	 h = 432;
	else
	 h = 507
	var top = (screen.height - h)/2;
	var left = (screen.width - w)/2;
	window.open('http://www.synechron.com/aboutus/brand_identity.htm','newwin','height='+h+', width=706, top='+top+', left='+left+', toolbars=no, maximize=no, resizable=yes, location=no, directories=no, scrollbars=no');
}

/* Function to open the photos from work culture*/

function openPop(Img){
 document.synImg.imgSel.value = Img;
 window.open('popup.htm','newWin','width=602,height=466,menubar=no');
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function popupcenter(pageURL, title,w,h) {	
	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
	var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}

function opennewWindow(url,newWindName,features){
		x = window.open(url, 'newWindName', 'toolbar=yes, location=yes, directories=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes')
		//self.close()
	}