/* Show/Hide 
------------------------------------------------------------------ */

function getMyPageDimensions(){
		var xScroll, yScroll, isMozilla;
	
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
			isMozilla = 1;
		} 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
			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 = windowWidth;
		} else {
			pageWidth = xScroll;
		}
		arrayPageSize = new Array(windowWidth,windowHeight,pageWidth,pageHeight, isMozilla)
		return arrayPageSize;
	}

function correct(aidi)
{
	//alert('asd!');
	var windowSize = getMyPageDimensions();
	var windowWidth = windowSize[0];
	var windowHeight = windowSize[1];
	var pageWidth = windowSize[2];
	var pageHeight = windowSize[3];
	var isMozilla = windowSize[4];
	//alert('windowHeight = ' + windowHeight + ' | pageHeight = ' + pageHeight + '\n isMozilla = ' + isMozilla);
	var x;
	if ( document.getElementById && (x = document.getElementById(aidi)) && x.style )
	{
		var currentHeight = x.parentNode.parentNode.parentNode.offsetHeight; //height of all html
		if (isMozilla && ((windowHeight - currentHeight) < 0)) {
			x.style.marginLeft = '-1px';
			
			var y = document.getElementById('main_content');
			y.style.backgroundPosition = '23px 100%';
			
			var z = document.getElementById('top_right').parentNode;
			if (z) z.style.marginLeft = '-1px';
			
			var z = document.getElementById('triple');
			if (z) z.style.marginLeft = '-1px';
			//alert(windowHeight - currentHeight);
		}
		
	}
	
	var asd = document.getElementsByClassName('title');
	if (asd.length) {
		for (i=0; i<asd.length; i++) {
			if (asd[i].offsetHeight < 68) asd[i].style.margin = (68 - asd[i].offsetHeight)/2 + 4 + 'px 0 0 0';
		}
	}
	
}


function showMe(num)
{
	for (var i=1; i>0; i++) {
		var curElement = document.getElementById('sublist_' + i);
		if (curElement) {
			var parElement = curElement.parentNode;
			if (num == i) {
			
				curElement.style.display = 'block';
				parElement.className = 'active';
			}
			else {
				curElement.style.display = 'none';
				parElement.className = '';
			}
		}
		else {
			var lastID = i-1;
			var last = document.getElementById('sublist_' + lastID);
			last.parentNode.className += ' last';
			//alert('here');
			break;
		}
	}
}

function showMeTab(num){
	for (var i=1; i>0; i++) {
		var curElement = document.getElementById('tab_' + i); 
		if (curElement) {
			var linkElement = document.getElementById('tabs').getElementsByTagName('a');
			//alert('i=' + i);
			if (num == i) {
				curElement.style.display = 'block';
				linkElement[i-1].className = 'active';
			}
			else {
				curElement.style.display = 'none';
				linkElement[i-1].className = '';
			}
		}
		else break;
	}
}

function showMeTripleTab(num){
	for (var i=1; i>0; i++) {
		var active;
		var curElement = document.getElementById('tab_' + i);
		if (curElement) {
			var linkElement = document.getElementById('tabs').getElementsByTagName('a');
			if (num == i) {
				active = i;
				curElement.style.display = 'block';
				linkElement[i-1].className = 'active';
				if (i == 2) linkElement[i-1].style.padding = '6px 12px';
			}
			else {
				curElement.style.display = 'none';
				linkElement[i-1].className = '';
			}
		}
		else break;
	}
	if (active == 1) linkElement[1].className = 'paddRight';
	if (active == 3) linkElement[1].className = 'paddLeft';
}


function checkform(){
		if(document.contact_us.c_name.value == ''){
			document.contact_us.c_name.focus();
			alert("Please Type Your Name! ");
			return(false);
		}
		if(document.contact_us.c_mail.value == ''){
			document.contact_us.c_mail.focus();
			alert("Please Type Your Email! ");
			return(false);
		}	
		if(document.contact_us.c_text.value == ''){
			document.contact_us.c_text.focus();
			alert("Please Type Your Message! ");
			return(false);
		}	
		  return(true);
}

function checkquestion(){ 
		if(document.question.name.value == ''){
			document.question.name.focus();
			alert("Please Type Your Name! ");
			return(false);
		}
		if(document.question.email.value == ''){
			document.question.email.focus();
			alert("Please Type Your Email! ");
			return(false);
		}
		if(document.question.text.value == ''){
			document.question.text.focus();
			alert("Please Type Your Message! ");
			return(false);
		}
		  return(true);
}

function checkapplay(){ 
		if(document.applayform.position.value == ''){
			document.applayform.position.focus();
			alert("Please choose a Position! ");
			return(false);
		}
		if(document.applayform.name.value == ''){
			document.applayform.name.focus();
			alert("Please Type Your Name! ");
			return(false);
		}
		if(document.applayform.email.value == ''){
			document.applayform.email.focus();
			alert("Please Type Your Email! ");
			return(false);
		}
		if(document.applayform.text.value == ''){
			document.applayform.text.focus();
			alert("Please Type Your Message! ");
			return(false);
		}
		  return(true);
}



function replaceRecaptchaBtns() { //recaptcha_switch_img
	var x, y, z, w;
	if ( document.getElementById && (x = document.getElementById('recaptcha_reload')) && x.style ) {
		if (document.getElementById && (y = document.getElementById('recaptcha_switch_audio')) && y.style) {
			if (document.getElementById && (z = document.getElementById('recaptcha_whatsthis')) && z.style) {
				if (document.getElementById && (w = document.getElementById('recaptcha_switch_img')) && w.style) {
					//alert('we`re here');
					x.src = '../website_uploads/Image/hardcodebycms/re-btn-1.jpg';
					y.src = '../website_uploads/Image/hardcodebycms/re-btn-2.jpg';
					z.src = '../website_uploads/Image/hardcodebycms/re-btn-3.jpg';
					w.src = '../website_uploads/Image/hardcodebycms/re-btn-4.jpg';
				}
			}
		}
	}
}











