// JavaScript Document

/////////// Used In page Career in  corporate ///////////////////////
function ChangeSpan(index,actionCl)
{
	description = "desc_"+index;
	current = "current_"+index;
	split_div = "split_"+index;
	if(actionCl == 'expand')
	{
		if(document.getElementById(current).innerHTML == '')
		{
			document.getElementById(current).innerHTML = document.getElementById(split_div).innerHTML;
			document.getElementById(split_div).innerHTML = document.getElementById(description).innerHTML;
			document.getElementById(description).innerHTML = '';
		}
	}
	
	if(actionCl == "collapse")
	{
		if(document.getElementById(description).innerHTML == '')
		{
			document.getElementById(description).innerHTML = document.getElementById(split_div).innerHTML;
			document.getElementById(split_div).innerHTML = document.getElementById(current).innerHTML;
			document.getElementById(current).innerHTML = '';
		}
	}
	init_dw_Scroll();
}
/////////// Used In page Career in  corporate ///////////////////////

function ChangePhotoOver(id_image,image_name)
{
	document.getElementById(id_image).src='images/'+image_name;
}

function ChangePhotoOut(id_image,image_name)
{
	document.getElementById(id_image).src='images/'+image_name;
}

function galleryCatering(index,photo,title)
{
	alert(index);
	document.getElementById(index).href='uploads/catering/'+photo;
	alert(document.getElementById(index).href);
	document.getElementById(index).title=title;
}

function ClearContactForm(x)
{
	document.getElementById(x).innerHTML = '';	
}

function ClearJobmail()
{
	document.getElementById('errorsDiv_mail').innerHTML = '';
	document.getElementById('checkmail').innerHTML = '';
}

function replaceChars(str,ch1,ch2)
{
	var ChaineStr = str;
	var IndexOfMatch = ChaineStr.indexOf(ch1);
	
	while(IndexOfMatch != -1)
	{
		ChaineStr = ChaineStr.replace(ch1,ch2);
		IndexOfMatch = ChaineStr.indexOf(ch1);
	}
	return ChaineStr ;
}

function replaceSpecialChars(str)
{
	str = replaceChars(str,"&","^_*");
	str = replaceChars(str,"+","^_^");
	str = replaceChars(str,"#","^_$");	
	return str;
}

function testMail()
{
	mail = replaceSpecialChars(document.getElementById('mail').value);
	makeRequest('all_request.php?action=checkE&mail='+mail,'checkmail','','','','ajax-loader.gif');	
}

function testMail2()
{
	mail = replaceSpecialChars(document.getElementById('mail').value);
	makeRequest('all_request.php?action=checkE&mail='+mail,'fff','','','','ajax-loader.gif');	
}

function OpenMenu()
{
	wid = screen.width;
	hei = screen.height;
	/*var left = (wid/2) - 50;
	var top = (hei/2) - 100;
	var option = " left = "+left+" , top = "+top+" , width = 1200 , height = 660, resizable=no";*/
	var option = "width = 1200 , height = 760, resizable=no, scrollbars = 1";
	window.open('menu.html','_blank',option);		
}
