/*--------------Holdlink()---------------*/
function holdlink(id, sub_id1, sub_id2){
	if(id=='home'){
	document.getElementById('inner_header').style.display='none';
	document.getElementById('home_header').style.display='';
	document.getElementById(id).style.display='none';
	} else
	document.getElementById(id).className='current';
}
/*--------------Holdlink()---------------*/

/*--------------------------popup() ----------------------------*/
function popup(path)
{

	var NewWin3;
	NewWin3=window.open(SITE_URL+"page/"+path+"/",'NewWin1','height=600,width=620,top=10,left=150,location=no,status=no,toolbar=no,menubar=no,scrollbars=yes');
	NewWin3.focus();
}
/*--------------------------consultation() ----------------------------*/

/*------------include function---------------------*/
function include_file(id, url) {
	
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
  if (req) {
    // Synchronous request, wait till we have it all
	req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } 
}
/*------------include function---------------------*/

/*Misc*/
function hometext(id){
	if(document.getElementById(id).style.display==''){
		document.getElementById(id).style.display='none';
	}else {
		document.getElementById(id).style.display='';
	}	
}
/*Misc*/

function processPayment() { 

	document.getElementById('submit_Payment').disabled="yes";
	//document.getElementById('edit_information').disabled="yes";
	var pagesize = getPPageSize();
	document.getElementById('shadowLayer').style.top=0;
	document.getElementById('shadowLayer').style.left=0;
	document.getElementById('shadowLayer').style.width=pagesize[0]+"px";
	document.getElementById('shadowLayer').style.height=pagesize[1]+"px";
	document.getElementById('shadowLayer').style.background="#000000";
	document.getElementById('shadowLayer').style.display="";
	
	document.getElementById('processingBox').style.top=0;
	document.getElementById('processingBox').style.left=0;
	document.getElementById('processingBox').style.border='4px solid #c9c9c9';
	document.getElementById('processingBox').style.background='#FFFFFF';
	document.getElementById('processingBox').style.top = ((pagesize[1])/2)+'px';;	
	document.getElementById('processingBox').style.left = ((pagesize[0]-200)/2)+'px';
	document.getElementById('processingBox').style.display="";
}

/********************** Update Class Of li for showing Navigation at left *************************/
function getPPageSize(){
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth) {	
		pageWidth = xScroll;		
	} else {
		pageWidth = windowWidth;
	}
	var total_width = windowWidth; 

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent) {
		while (1) {
			curleft+=obj.offsetLeft;
			if (!obj.offsetParent) {
				break;
			}
			obj=obj.offsetParent;
		}
	} else if (obj.x) {
		curleft+=obj.x;
	}
	return curleft;
}
//var total_width;
function updatePosition (obj) { //alert(total_width);
	var total_width = document.getElementById('total_width').value;
	var posX = findPosX(obj);
	if((total_width-posX) <= 298) 
		obj.className = 'update';
}
// popup window for cvv
function getCVV(url) {
		
		var wid = 470;
		var height = 350;
		var  w = screen.width;
		var h = screen.height;
		var x= h/2-height/2;
		var y = w/2-wid/2; 
		view=window.open(url+"html/cvv.html","","width="+wid+",height="+height+",top="+x+",left="+y+",scrollbars=1");
		 
	}
/****************************************************************************************************/


