var xPos = screen.width/2;
var yPos = screen.height/2;

function doPopupin(){
	x = xPos-175;
	y = yPos-175;
	winIn = window.open(siteURL+"corporate/globalpresence/inoffice.php","0001","width=450,height=437,resizable=no,toolbar=no,scrollbars=yes,left="+x+",top="+y);
}
function doPopupSW(){
	x = xPos-175;
	y = yPos-175;
	winIn = window.open(siteURL+"corporate/globalpresence/swoffice.php","0001","width=450,height=240,resizable=no,toolbar=no,scrollbars=yes,left="+x+",top="+y);
}
function doPopuppa(){
	x = xPos-175;
	y = yPos-175;
	winIn = window.open(siteURL+"corporate/globalpresence/paoffice.php","0001","width=450,height=240,resizable=no,toolbar=no,scrollbars=yes,left="+x+",top="+y);
}
function doPopupus2(){
	x = xPos-150;
	y = yPos-125;
	winIn = window.open(siteURL+"corporate/globalpresence/usoffice2.php","0001","width=300,height=279,resizable=no,toolbar=no,scrollbars=yes,left="+x+",top="+y);
}
function doPopupnl(){
	x = xPos-150;
	y = yPos-137;
	winIn = window.open(siteURL+"corporate/globalpresence/nloffice.php","0001","width=300,height=274,resizable=no,toolbar=no,scrollbars=no,left="+x+",top="+y);
}
function doPopupGr(){
	x = xPos-150;
	y = yPos-143;
	winIn = window.open(siteURL+"corporate/globalpresence/groffice.php","0001","width=300,height=250,resizable=no,toolbar=no,scrollbars=no,left="+x+",top="+y);
}
function doPopupDu(){
	x = xPos-150;
	y = yPos-140;
	winIn = window.open(siteURL+"corporate/globalpresence/dboffice.php","0001","width=300,height=200,resizable=no,toolbar=no,scrollbars=no,left="+x+",top="+y);
}
function doPopupUK(){
	x = xPos-150;
	y = yPos-114;
	winIn = window.open(siteURL+"corporate/globalpresence/ukoffice.php","0001","width=300,height=250,resizable=no,toolbar=no,scrollbars=no,left="+x+",top="+y);
}
function doPopupFi(){
	x = xPos-150;
	y = yPos-114;
	winIn = window.open(siteURL+"corporate/globalpresence/fioffice.php","0001","width=300,height=260,resizable=no,toolbar=no,scrollbars=no,left="+x+",top="+y);
}
function doPopupdk(){
	x = xPos-150;
	y = yPos-124;
	winIn = window.open(siteURL+"corporate/globalpresence/dkoffice.php","0001","width=300,height=210,resizable=no,toolbar=no,scrollbars=no,left="+x+",top="+y);
}
function doPopupca(){
	x = xPos-150;
	y = yPos-124;
	winIn = window.open(siteURL+"corporate/globalpresence/caoffice.php","0001","width=300,height=210,resizable=no,toolbar=no,scrollbars=no,left="+x+",top="+y);
}
function doPopupMap(){
	x = xPos-245;
	y = yPos-250;
	winIn = window.open(siteURL+"corporate/contact/direction.php","0002","width=490,height=500,resizable=no,toolbar=no,scrollbars=yes,left="+x+",top="+y);
}
function doMail(toName,toEmail){
	var x,y;
	x = xPos-300 ;
	y = yPos-160 ;
	winIn = window.open(siteURL+"contactmail/emailCommon.php?toName="+toName+"&toEmail="+toEmail,"0002","width=600,height=320,resizable=no,toolbar=no,scrollbars=no,left="+x+",top="+y);
	if(!winIn){
		alert('Pop is blocked in your browser.');
	}
}
function doMailAttach(toName,toEmail){
	var x,y;
	x = xPos-300 ;
	y = yPos-180 ;
	winIn = window.open(siteURL+"contactmail/emailCommonAttach.php?toName="+toName+"&toEmail="+toEmail,"0002","width=600,height=360,resizable=no,toolbar=no,scrollbars=no,left="+x+",top="+y);
	if(!winIn){
		alert('Pop is blocked in your browser.');
	}
}
function toggle(div)   {  
	var option=['ng','im','vm','ps','cg','mb','ak','jm','sk','vn','pm','bg','fm','ngu','tv','ssk','pk','ph','gd'];

	for(var i=0; i<option.length; i++){
		obj=document.getElementById(option[i]);
		if(obj){
			obj.style.display=(option[i]==div) && !(obj.style.display=="")? "" : "none";
		}
	}
}
function showco(text_id){
		if(document.getElementById(text_id).style.display == "none"){
			document.getElementById(text_id).style.display = "";
		}else{
			document.getElementById(text_id).style.display = "none";
		}
}

contArr = new Array("ppm","nppm","mbm","ogd","mc","ic");

function showco_bpo(text_id){
	for(i=0;i<contArr.length;i++){
		
		if(text_id == contArr[i]){
			document.getElementById(contArr[i]).style.display = "";
			if(document.getElementById(contArr[i]+"_1"))  { document.getElementById(contArr[i]+"_1").style.display = ""; }
		}else{
			document.getElementById(contArr[i]).style.display = "none";
			if(document.getElementById(contArr[i]+"_1"))  { document.getElementById(contArr[i]+"_1").style.display = "none"; }
		}
	}
}

function switchto(value){
	var a = new Array('services','technologies');
	for(i=0;i<a.length;i++){
		if(a[i] == value){
			try{
			document.getElementById(a[i]).style.display = "";
			}catch(e){}
			
		}else{
			try{
			document.getElementById(a[i]).style.display = "none";
			}catch(e){}
		}
	}
}
function openWindow(url, name){
	
 popupWin = window.open(siteURL+url, '', 'dependent,scrollbars,resizable=no,width=275,height=200,left=75,top=100')
}
function nascommpopup(){
		winIn = window.open(siteURL+'Contract_Gateway/whyos/nascomm.php','popup','width=1000,height=700,resizable=no,toolbar=no,scrollbars=yes');
}
function doproductDev(url){
		x = xPos-150;
		y = yPos-140;
		winIn = window.open(siteURL+url,"0001","width=600,height=600,resizable=no,toolbar=no,scrollbars=yes,left="+x+",top="+y);
}
function UpdatePageTitle(lang,reference_id,title,exetime){
	var is_admin = "NO";
	var docObj = null;
	if (typeof window.ActiveXObject != 'undefined'){
		docObj = new ActiveXObject("Microsoft.XMLHTTP"); 
	}else{ 
		docObj = new XMLHttpRequest(); 
	}
	docObj.open("GET", "updatetitle.php?lang="+lang+"&reference_id="+reference_id+"&title="+title+"&exetime="+exetime, false);
	docObj.send(null);	
}

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

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];}
}
var win= null;

function NewWindow(mypage,myname,w,h,scroll){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable=yes';
  win=window.open(siteURL+"/"+mypage,myname,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function openlivechat(){
	this.newWindow = window.open('http://chat.boldchat.com/chat/visitor.jsp?cdid=2200888811&url=' + document.location, 'Chat', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=640,height=480'); 
	this.newWindow.focus(); 
	this.newWindow.opener = window;
	return false;
}
function hideshow(compo){
	if(document.getElementById(compo).style.display == 'none'){
		document.getElementById(compo).style.display = '';
	}else{
		document.getElementById(compo).style.display = 'none';
	}
	
	if((document.getElementById('gtlcelebrates').style.display == 'none') && (document.getElementById('bestcompany').style.display == 'none')){
			document.getElementById("gtlcelebrates1").style.display = 'none';
	}else{
			document.getElementById("gtlcelebrates1").style.display = '';
	}
}

