fromFlag = '';


function CreateHttpObject() {
var objXMLHttp=null
if(window.XMLHttpRequest){//case for ie7+ and opera,ff,chrome,safari
objXMLHttp = new XMLHttpRequest();
}
else if(window.ActiveXObject){//case ie5 and 6
objXMLHttp = ActiveXObject("Microsoft.XMLHTTP");
}
else{
alert("Your Browser Does Not Support XMLHTTP");
return null; //return null in case no browser support
}
return objXMLHttp
}


contentObj = "";
function postAjaxFile(urlPage,parameters) {
	xmlHttpPost=CreateHttpObject()
	if (xmlHttpPost==null) {
		alert ("Browser does not support HTTP Request")
		return
	} 
	xmlHttpPost.onreadystatechange=stateChangedPost
	xmlHttpPost.open("POST",urlPage,true);
	xmlHttpPost.setRequestHeader("Content-type", "application/x-www-form-urlencoded");   
	//alert(parameters)
	xmlHttpPost.setRequestHeader("Content-length", parameters .length);   
	xmlHttpPost.setRequestHeader("Connection", "close"); 
	xmlHttpPost.send(parameters)
	
}

function GWT_entryPoint(){
	fixtheuploader();
}
function stateChangedPost() { 
	if (xmlHttpPost.readyState==4 || xmlHttpPost.readyState=="complete") { 
		//fromFlag
	    //contentObj.innerHTML=xmlHttpPost.responseText;
		//alert(xmlHttpPost.responseText);
	   if (fromFlag == 1){
		  //  alert(xmlHttpPost.responseText)
		    
			document.getElementById('not_message_contact').style.display = 'block'; 
			setTimeout(function(){Collapse('contacus')},3000);
		   
		   
		   contentObj.innerHTML = ''
		  }else if (fromFlag == 2) {
			  
			document.getElementById('not_message_newsletter').style.display = 'block'; 
			setTimeout(function(){CollapseNewsLetter()},3000);
			contentObj.innerHTML = ''
		  
		// document.getElementById('loader').style.display = 'none';  
		// document.getElementById('comfirm').style.display = 'block'; 
		// document.news_letter.reset()
		  // setTimeout(function(){showNewsLetter(0)},1000);
		
		  }else if (fromFlag == 3) {
		//\ alert(xmlHttpPost.responseText)
			document.getElementById('not_message_careers').style.display = 'block'; 
			setTimeout(function(){hideCareerApp()},3000);
			//hideCareerApp();
			contentObj.innerHTML = ''
			//alert(xmlHttpPost.responseText);
		 }else if (fromFlag == 5) {
		// alert(xmlHttpPost.responseText)
			document.getElementById("not_message_spot").innerHTML = "Thank you. Spotlight on Article has been successfully forwarded. ";
			document.getElementById('divEmails').style.display="none";
			//hidePage();
			//alert(xmlHttpPost.responseText);	
		}else if (fromFlag == 4) {
			//hideCareerApp();
			contentObj.innerHTML = ''
			//alert(xmlHttpPost.responseText)
			if(xmlHttpPost.responseText == '0'){
				document.getElementById('error_div').innerHTML = 'Invalid email or password please try again'	;
				
			}else{
				window.location = 'knowledge_center.asp'
			}
		 }else if (fromFlag == 6) {
			//hideCareerApp();
			contentObj.innerHTML = ''
			//alert(xmlHttpPost.responseText)
			if(xmlHttpPost.responseText == '0'){
				document.getElementById('error_div1').innerHTML = 'Invalid email or password please try again'	;
				
			}else{
				window.location = 'knowledge_center.asp'
			}
		 }else {
			 contentObj.innerHTML=xmlHttpPost.responseText 
			 }
		 
		//Refreshyoursay();
	 } 
} 
function  getSpot(id){
	fromFlag = '';
	 contentObj=document.getElementById('spolight_content');
	 load_str='<table width=100% border=0 cellspacing=0 cellpadding=0><tr bgcolor><td  valign=top width=6><img src=images/spacer.gif height=30 width=1></td><td   valign=top align=center style=padding-top:30px ><img src=images/loading.gif?r=1></td><td width=1 valign=top >&nbsp;</td></tr></table>'
	contentObj.innerHTML = load_str
	var poststr = "spotlightid="+encodeURI(id);
	postAjaxFile("getSpot.asp",poststr);
}

function getSpotDesc(id){
	fromFlag = '';
	 contentObj=document.getElementById('spotContent');
	 load_str='<table width=100% border=0 cellspacing=0 cellpadding=0><tr bgcolor><td  valign=top width=6><img src=images/spacer.gif height=30 width=1></td><td   valign=top align=center style=padding-top:30px ><img src=images/loading.gif?r=1></td><td width=1 valign=top >&nbsp;</td></tr></table>'
	contentObj.innerHTML = load_str
	var poststr = "spotlightid="+encodeURI(id);
	postAjaxFile("getSotDesc.asp",poststr);
}

oldSpot = '';
function selectThis(id,oldId){
	id = id;
	oldId = oldId ;
	if (oldSpot.length == 0)
	{
		oldSpot = oldId;		
	}
	document.getElementById(id).className = 'selected';
	document.getElementById(oldSpot).className = ''
	oldSpot = id 
}
function showPopUp(thisid,flag) {
	if (document.getElementById('wrapper') != null )
	{
			document.getElementById('opacitiDiv').style.height=document.getElementById('wrapper').offsetHeight+"px"; 
			//alert(document.getElementById('wrapper').offsetHeight)
			document.getElementById('conttainerPoUp').style.display='block'//27 px height of the bottom div
	
			showPage(thisid,flag);
	}

}
function chowhideContact(){
	Collapse('sitemap',2);
	openedSection = 2;
	}
function chowhideCustomer(){
	Collapse('sitemap',4);
	openedSection = 4;
	selectCenter(1);
	}
function chowhideCustomer2(){
	Collapse('sitemap',4);
	openedSection = 4;
	selectCenter(2);
	}
	
function chowhidelocation(){
	Collapse('sitemap',3);
	openedSection = 3;
	
	
	}
	spotid = ''
function chowhideSpot(id){
	Collapse('sitemap',1);
	openedSection = 1;
	spotid =  id;
	}	
var openedSection = 0
function showPage(thisid,flag){
	flag = flag;
	thisId = thisid;
	openedSection = flag;	
	document.getElementById('opacitiDiv').style.display='block'//27 px height of the bottom div
	if (flag == 1 )// SpotLight
	{	//openedSection = 1
		//document.getElementById("not_message_spot").style.display = "none"
		getSpotDetail(thisId);	
	}else if (flag == 2)
	{	document.getElementById('not_message_contact').style.display = 'none';
		window.scroll(0,0)
		showContact();	
	
	}else if (flag == 3)
	{
		showLocation();	
	}else if (flag == 4)
	{
		showSiteMap();	
	}else if (flag == 5)
	{
		getNewsDetail(thisid);	
	}else if (flag == 6)
	{
		getNewsLetter();	
	}else if (flag == 7)
	{	//setUploadDiv()
		getCareerApp(thisid);	
	}else if (flag == 8)
	{
		getLogIn(thisid);	
	}else if (flag == 9)
	{
		showPic(1,thisid)	
	}
	
	
	
}
function setUploadDiv()
{
	document.getElementById("slot1").innerHTML="<div id=slot1><div tabindex=0 class=gwt-FocusPanel><table cellspacing=0 cellpadding=0><tbody><tr><td align=left style=vertical-align: top;><div tabindex=0><table cellspacing=0 cellpadding=0><tbody><tr><td align=left style=vertical-align: top;><form target=FormPanel_1 class=formPanel enctype=multipart/form-data method=post><input type=file class=ok name=sss></form></td><td align=left style=vertical-align: top;><table cellspacing=0 cellpadding=0 border=1 class=GreyBkg style=display: none;><tbody><tr><td height=22 width=200 align=left style=vertical-align: top;><div style=overflow: hidden; position: relative; width: 200px; height: 20px;><div class=BlueBkg style=width: 0px; height: 20px; position: absolute; left: 0px; top: 0px;>&nbsp;</div><div class=loadingText style=position: absolute; left: 10px; top: 2px;></div><img src=http://shift/websites/bsynchro/website/Uploader.index/images/CloseOver.png class=cursor style=width: 14px; height: 14px; display: none; position: absolute; left: 186px; top: 1px;></div></td></tr></tbody></table></td></tr></tbody></table></div></td></tr></tbody></table></div></div>"	
}
function getclickTarget(e){
	var targ;
	if (!e) var e = window.event;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
	if (targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode;
		//alert(targ.id)
		return targ.id;
	}
	
//document.getElementById('sd').nodeType
function  hide(e){
	var sourceId = getclickTarget(e);
	if (sourceId == 'news_letter_hidden' || sourceId == 'opacitiDiv' || sourceId == 'conttainerPoUp'){
		if (openedSection == 1){
			
		}else if (openedSection == 2){
			Collapse('contacus');
		
		}else if (openedSection == 3){
			Collapse('location');
		
		}else if (openedSection == 4){
			Collapse('sitemap')
		
		
		}else if (openedSection == 9){
		
			showPic(0)
		
		}

	}
	
	
}
 divToadd = "";
function showContact(){
//	var content_divToadd = document.getElementById('contacus').cloneNode(true);
//	//divToadd.cloneNode(
//	//alert(content_divToadd.innerHTML)
//	divToadd = document.createElement('DIV')
//	//divToadd.className = document.getElementById('contacus').className;
//	//alert(content_divToadd)
//	divToadd.setAttribute('id','thisContact')
//	divToadd.style.height = '0px'
//	divToadd.style.right = '0px';
//	divToadd.style.top = '23px';
//	divToadd.style.overflow ='hidden';
//	divToadd.className ='popup';
////	divToadd.style.backgroundColor = '#cc00000';
//	//divToadd.appendChild(content_divToadd);
//	//divToadd.innerHTML = content_divToadd.innerHTML
//	divToadd.onmouseup = function(){Collapse('thisContact')}
//	alert(divToadd.innerHTML)
//	contentObj=document.getElementById('conttainerPoUp').appendChild(divToadd);
//	//contentObj=document.getElementById('conttainerPoUp')
//	divToadd.innerHTML = content_divToadd.innerHTML;
//	
//	alert(contentObj.innerHTML)
	//divToadd.style.height = '200px';
	expandDiv('contacus',400);
	//Container.add(divToadd,0);
	
}

function showLocation(){
	expandDiv('location',670);
	
}
function showSiteMap(){
	expandDiv('sitemap',670);
	
}
function getCareerApp(thisId){
	titles = thisId;
	
	document.getElementById('not_message_careers').style.display = 'none'; 
	
	if(titles.length >0){
		roger = titles.split(';')	
	}
	document.getElementById('jobTitle').innerHTML = roger[1]
	document.getElementById('title_form_career').innerHTML = roger[0]
	if (roger[0] == "Job Vacancies" || roger[0] == "Internship Vacancies"  )
	{
		document.getElementById('jobtarget_div').style.display = 'none';
		document.getElementById('type_div').style.display = 'none';
		document.getElementById('jobTitle').style.visibility = 'visible';
	}else
	{	//alert(roger[0])
		document.getElementById('jobtarget_div').style.display = 'block';
		document.getElementById('type_div').style.display = 'block';
		document.getElementById('jobTitle').style.visibility = 'hidden';
	}
	
	var exampleFx = new Fx.Morph('applyCareers', {
						duration: 500,
						onComplete: function(){
                //and here we apply the highlight effect on complete
	        										//alert('df')
										isSlid=false;
										isopen = true;
										//	alert('d')
									}

					});
				//if (!isSlid & !isopen){
					isSlid=true;
					exampleFx.start({
						'left':[530,175],
						'top':[480,173],
						'width':[0,686],
						'height':[0,640]
						//'top':[posy,posy-407],
						//'right':[-6000,0]
						
						//'display:'block
						
						
					});	

			//	}

	
	}
function getLogIn(thisid){
	if (thisid  == 1){
		document.getElementById('error_div').innerHTML = 'Your session ended due to inactivity. Please log in again';
	}else{
		document.getElementById('error_div').innerHTML = '';
	}
	var exampleFx = new Fx.Morph('login_files', {
						duration: 500,
						onComplete: function(){
                //and here we apply the highlight effect on complete
	        										//alert('df')
										isSlid=false;
										isopen = true;
									}

					});
				//if (!isSlid & !isopen){
					isSlid=true;
					exampleFx.start({
						'left':[530,300],
						'top':[480,173],
						'width':[0,473],
						'height':[0,321]
						//'top':[posy,posy-407],
						//'right':[-6000,0]
						
						//'display:'block
						
						
					});	

			//	}

	
	}
	
function hideCareerApp(thisId){
	
	var exampleFx = new Fx.Morph('applyCareers', {
						duration: 500,
						onComplete: function(){
                //and here we apply the highlight effect on complete
	        										//alert('df')
										isSlid=false;
										isopen = true;
										hidePage();
									}

					});
				//if (!isSlid & !isopen){
					isSlid=true;
					exampleFx.start({
						'left':[165,530],
						'top':[163,480],
						'width':[646,0],
						'height':[526,0]
						//'top':[posy,posy-407],
						//'right':[-6000,0]
						
						//'display:'block
						
						
					});	

			//	}

	
	}

function hideLogIn(tohidePage){
	var tohidePage = tohidePage;
	var exampleFx = new Fx.Morph('login_files', {
						duration: 500,
						onComplete: function(){
                //and here we apply the highlight effect on complete
	        										//alert('df')
										isSlid=false;
										isopen = true;
										if (!tohidePage){
										hidePage();
										}
									}

					});
				//if (!isSlid & !isopen){
					isSlid=true;
					exampleFx.start({
						'left':[300,530],
						'top':[173,480],
						'width':[473,0],
						'height':[221,0]
						//'top':[posy,posy-407],
						//'right':[-6000,0]
						
						//'display:'block
						
						
					});	

			//	}

	
	}


function expandDiv(divid,toHeight){
	selectID = divid+'_selected'
	if (document.getElementById(selectID)){
		document.getElementById(selectID).style.visibility = 'visible'
	}
	var exampleFx = new Fx.Morph(divid, {
						duration: 500,
						onComplete: function(){
                //and here we apply the highlight effect on complete
	        										//alert('df')
										isSlid=false;
										isopen = true;
									}

					});
				//if (!isSlid & !isopen){
					isSlid=true;
					exampleFx.start({
						//'opacity':[0,1],
						//'width':[0,600],
						//'width':[0,362],
						'height':[0,toHeight]
						//'top':[posy,posy-407],
						//'right':[-6000,0]
						
						//'display:'block
						
						
					});	

			//	}
}

function Collapse(divid,myflag){
	selectID = divid+'_selected'
	document.contactForm.reset();
	var exampleFx = new Fx.Morph(divid, {
						duration: 500,
						onComplete: function(){
                //and here we apply the highlight effect on complete
	        										//alert('df')
										isSlid=false;
										isopen = true;
											if (document.getElementById(selectID)){
												document.getElementById(selectID).style.visibility = 'hidden'
													}
										if ( myflag == 2){
											showContact();
										}else if (myflag == 3	)
										{
											showLocation();
										}else if (myflag == 1	)
										{
											showPopUp(spotid,1);	
										}else if (myflag == 4	)
										{
											showPopUp(spotid,8);	
										}else
										{
											hidePage();
										}
									
										
										
									}

					});
				//if (!isSlid & !isopen){
					isSlid=true;
					exampleFx.start({
						//'opacity':[0,1],
						//'width':[0,600],
						//'width':[0,362],
						'height':[400,0]
						//'top':[posy,posy-407],
						//'right':[-6000,0]
						
						//'display:'block
						
						
					});	
//document.getElementById('conttainerPoUp').removeChild(0);					
	
}
function selectCenter(id){
	if (id == 1)
	{
		document.getElementById('knowledge_tab1').className = 'selected';
		document.getElementById('knowledge_tab2').className = '';
		document.getElementById('knowledge_tab1_div').style.display = 'block';
		document.getElementById('knowledge_tab2_div').style.display = 'none';
	}else
	{
		document.getElementById('knowledge_tab2').className = 'selected';
		document.getElementById('knowledge_tab1').className = '';
		document.getElementById('knowledge_tab1_div').style.display = 'none';
		document.getElementById('knowledge_tab2_div').style.display = 'block';
	}
	
}
function getNewsLetter(){
	document.getElementById('not_message_newsletter').style.display = 'none'; 	
	document.getElementById('news_letter_hidden').style.display='block';
	
		//selectID = divid+'_selected'
//	if (document.getElementById(selectID)){
	//	document.getElementById(selectID).style.visibility = 'visible'
	//}
	var exampleFx = new Fx.Morph('news_letter', {
						duration: 500,
						onComplete: function(){
                //and here we apply the highlight effect on complete
	        										//alert('df')
										isSlid=false;
										isopen = true;
											
									}

					});
				//if (!isSlid & !isopen){
					isSlid=true;
					exampleFx.start({
						//'opacity':[0,1],
						//'width':[0,600],
						//'width':[0,362],
						'bottom':[-320,1]
						//'top':[posy,posy-407],
						//'right':[-6000,0]
						
						//'display:'block
						
						
					});	

			//	}

	
}
function CollapseNewsLetter(){
	//document.getElementById('news_letter').style.height='100px';
	
		//selectID = divid+'_selected'
//	if (document.getElementById(selectID)){
	//	document.getElementById(selectID).style.visibility = 'visible'
	//}
	//document.forms.newsletter_form.reset();
	document.newsletter_form.reset();
	contentObj.innerHTML = "";
	var exampleFx = new Fx.Morph('news_letter', {
						duration: 500,
						onComplete: function(){
                //and here we apply the highlight effect on complete
	        										//alert('df')
										isSlid=false;
										isopen = true;
										hidePage();
											document.getElementById('news_letter_hidden').style.display='none';
										
										
										
									}

					});
				//if (!isSlid & !isopen){
					isSlid=true;
					exampleFx.start({
						//'opacity':[0,1],
						//'width':[0,600],
						//'width':[0,362],
						'bottom':[1,-320]
						//'top':[posy,posy-407],
						//'right':[-6000,0]
						
						//'display:'block
						
						
					});	

			//	}

	
}






function getSpotDetail(thisId){
	fromFlag = '';
		contentObj=document.getElementById('conttainerPoUp');
			 load_str='<table width=100% border=0 cellspacing=0 cellpadding=0><tr bgcolor><td  valign=top width=6><img src=images/spacer.gif height=30 width=1></td><td   valign=top align=center style=padding-top:30px ><img src=images/ajax-loader1.gif?r=1></td><td width=1 valign=top >&nbsp;</td></tr></table>'
	contentObj.innerHTML = load_str
	var poststr = "spotlightid="+encodeURI(thisId);
	postAjaxFile("getSpotDetails.asp",poststr);
}
function getNewsDetail(thisId){
	fromFlag = '';
		contentObj=document.getElementById('conttainerPoUp');
			 load_str='<table width=100% border=0 cellspacing=0 cellpadding=0><tr bgcolor><td  valign=top width=6><img src=images/spacer.gif height=30 width=1></td><td   valign=top align=center style=padding-top:30px ><img src=images/ajax-loader1.gif?r=1></td><td width=1 valign=top >&nbsp;</td></tr></table>'
	contentObj.innerHTML = load_str
	var poststr = "newsid="+encodeURI(thisId);
	postAjaxFile("newsDetails.asp",poststr);
}
function hidePage(){
	document.getElementById('conttainerPoUp').innerHTML = '';
	document.getElementById('opacitiDiv').style.display='none'//27 px height of the bottom div
	
}
	
function submitcontact(){
	isValid = true;

	if (document.getElementById('ContactName').value.length == 0)
	{
		document.getElementById('ContactNameDiv').innerHTML = '<b>(is Required)</b>'	
		isValid = false ;
		
	}else {
		document.getElementById('ContactNameDiv').innerHTML = '';	
		ContactName = document.getElementById('ContactName').value
	}
	
	
	//if (document.getElementById('CompanyName').value.length == 0)
//	{
//		document.getElementById('CompanyNameDiv').innerHTML = '(is Required)'
//		isValid = false ;
//	}else {
//		document.getElementById('CompanyNameDiv').innerHTML = '';	
//	}
	CompanyName = document.getElementById('CompanyName').value;
	Position = document.getElementById('Position').value;
	MobileNumber = document.getElementById('MobileNumber').value;
	
	if (document.getElementById('PhoneNumber').value.length == 0)
	{
		document.getElementById('PhoneNumberDiv').innerHTML = '(is Required)'	
		isValid = false ;
	}else {
		document.getElementById('PhoneNumberDiv').innerHTML = '';
		PhoneNumber= document.getElementById('PhoneNumber').value;
	}
	
	


	

		var email = document.getElementById('thisemail').value
		AtPos = email.indexOf("@")
		StopPos = email.lastIndexOf(".")

	if (AtPos == -1 || StopPos == -1)
	{
		document.getElementById('EmailDiv').innerHTML = '(Enter a valid email)'	
		isValid = false ;
	}else
	{
		document.getElementById('EmailDiv').innerHTML = '';
		thisemail = email;
	}
	Country = document.getElementById('Country').value
	Comments = document.getElementById('Comments').value
	if (isValid == true)
	{	//alert(isValid)
		sendContact(ContactName,CompanyName,Position,MobileNumber,PhoneNumber,thisemail,Country,Comments)
	}else
	{
		//return 	isValid ;
	}
}
function SepcifyOther()
{
	if (document.getElementById('TargetJob').value == 'Other'){	
	
		document.getElementById('otherJob').style.display = 'block';
	}else{
		document.getElementById('otherJob').style.display = 'none';
		
	}	
}
function validateInteger( strValue ) {
/************************************************
DESCRIPTION: Validates that a string contains only
    valid integer number.

PARAMETERS:
   strValue - String to be tested for validity

RETURNS:
   True if valid, otherwise false.
**************************************************/
  var objRegExp  = /(^-?\d\d*$)/;

  //check for integer characters
  //alert(objRegExp.test(strValue))
  return objRegExp.test(strValue);
}

function submitCareer(){
	isValid = true;

	if (document.getElementById('CFirstName').value.length == 0)
	{
		document.getElementById('CFirstNameDiv').innerHTML = '(is Required)'	
		isValid = false ;
		
	}else {
		document.getElementById('CFirstNameDiv').innerHTML = '';	
		ContactName = document.getElementById('CFirstName').value
	}
	
	
	//if (document.getElementById('CompanyName').value.length == 0)
//	{
//		document.getElementById('CompanyNameDiv').innerHTML = '(is Required)'
//		isValid = false ;
//	}else {
//		document.getElementById('CompanyNameDiv').innerHTML = '';	
//	}
//alert(document.getElementById('jobTitle').innerHTML)
	var jobTitle = document.getElementById('jobTitle').innerHTML;
//	alert('roegr')
	var title_form_career = document.getElementById('title_form_career').innerHTML

	
	Gender = document.getElementById('CGender').value;
	//MobileNumber = document.getElementById('CMobileNumber').value;
	
	TargetJob = document.getElementById('TargetJob').value;
	TypeJob = document.getElementById('TypeJob').value;
	COtherJob =""
	if (roger[0]=='Spontaneous Application '){
		COtherJob =document.getElementById('COtherJob').value
	if (document.getElementById('TargetJob').value.length == 0)
	{
		document.getElementById('CtargetDiv').innerHTML = '(is Required)'	
		isValid = false ;
	}else {
		document.getElementById('CtargetDiv').innerHTML = '';
		MobileNumber= document.getElementById('TargetJob').value;
	}
	}
	if (document.getElementById('CMobileNumber').value.length == 0)
	{
		document.getElementById('CMobileNumbeDiv').innerHTML = '(is Required)'	
		isValid = false ;
	}else{
		if (!validateInteger(document.getElementById('CMobileNumber').value))
		{
			document.getElementById('CMobileNumbeDiv').innerHTML = '(Enter a valid number)'		
		}else{
			document.getElementById('CMobileNumbeDiv').innerHTML = '';
			MobileNumber= document.getElementById('CMobileNumber').value;
		}
		 
		
	}
	
	if (document.getElementById('CFatherName').value.length == 0)
	{
		document.getElementById('CFatherNameDiv').innerHTML = '(is Required)'	
		isValid = false ;
	}else {
		document.getElementById('CFatherNameDiv').innerHTML = '';
		FatherName= document.getElementById('CFatherName').value;
	}
	
	if (document.getElementById('id1').value.length == 0)
	{	
		document.getElementById('id1Div').innerHTML = '(is Required)'	
		isValid = false ;
	}else {
		document.getElementById('id1Div').innerHTML = '';
	//	alert( document.getElementById('id1').value)
		myCv = document.getElementById('id1').value;
	}
	
	if (document.getElementById('CUserName').value.length == 0)
	{
		document.getElementById('CUserNameDiv').innerHTML = '(is Required)'	
		isValid = false ;
	}else {
		document.getElementById('CUserNameDiv').innerHTML = '';
		UserName = document.getElementById('CUserName').value;
	}
	
	if (document.getElementById('CLandlineNumber').value.length == 0)
	{
		document.getElementById('CLandlineNumberDiv').innerHTML = '(is Required)'	
		isValid = false ;
	}else {
		document.getElementById('CLandlineNumberDiv').innerHTML = '';
		LandlineNumber= document.getElementById('CLandlineNumber').value;
	}
	


	

		var email = document.getElementById('Cthisemail').value
		AtPos = email.indexOf("@")
		StopPos = email.lastIndexOf(".")

	if (AtPos == -1 || StopPos == -1)
	{
		document.getElementById('CthisemailDiv').innerHTML = '(Enter a valid email)'	
		isValid = false ;
	}else
	{
		document.getElementById('CthisemailDiv').innerHTML = '';
		thisemail = email;
	}
	Comments = document.getElementById('CComments').value
	if (isValid == true)
	{	
		sendCareer(ContactName,MobileNumber,FatherName,LandlineNumber,UserName,Gender,thisemail,Comments,myCv,jobTitle,title_form_career,TargetJob,TypeJob,COtherJob);
		refreshUploader();
		setTimeout(function(){document.careerForm.reset()},6000);
		
	}
	else
	{
		//return 	isValid ;
	}
}

function submitNewlwtter(){
	isValid = true;

	if (document.getElementById('Nname').value.length == 0)
	{
		document.getElementById('NnameDiv').innerHTML = '(is Required)'	
		isValid = false ;
		
	}else {
		document.getElementById('NnameDiv').innerHTML = '';	
		ContactName = document.getElementById('Nname').value
	}
	
	
	//if (document.getElementById('CompanyName').value.length == 0)
//	{
//		document.getElementById('CompanyNameDiv').innerHTML = '(is Required)'
//		isValid = false ;
//	}else {
//		document.getElementById('CompanyNameDiv').innerHTML = '';	
//	}
	CompanyName = document.getElementById('NCompanyNameDiv').value;
	Position = document.getElementById('NPosition').value;
	MobileNumber = document.getElementById('NMobileNumber').value;
	
	if (document.getElementById('NPhoneNumber').value.length == 0)
	{
		document.getElementById('NPhoneNumberDiv').innerHTML = '(is Required)'	
		isValid = false ;
	}else {
		document.getElementById('NPhoneNumberDiv').innerHTML = '';
		PhoneNumber= document.getElementById('NPhoneNumber').value;
	}
		var email = document.getElementById('NEmail').value
		AtPos = email.indexOf("@")
		StopPos = email.lastIndexOf(".")

	if (AtPos == -1 || StopPos == -1)
	{
		document.getElementById('NEmailDiv').innerHTML = '(Enter a valid email)'	
		isValid = false ;
	}else
	{
		document.getElementById('NEmailDiv').innerHTML = '';
		thisemail = email;
	}
	Country = document.getElementById('Country').value
	Comments = document.getElementById('Comments').value
	if (isValid == true)
	{	//alert(isValid)
		sendNewsletter(ContactName,CompanyName,Position,MobileNumber,PhoneNumber,thisemail,Country,Comments)
	}else
	{
		//return 	isValid ;
	}
}


function showcontatHideLogin(){
	hideLogIn(1);
	showPopUp(0,2);
}

function submitTest1(){
	isValid = true;

	if (document.getElementById('Tname').value.length == 0)
	{
		document.getElementById('TnameDiv').innerHTML = '(is Required)'	
		isValid = false ;
		
	}else {
		document.getElementById('TnameDiv').innerHTML = '';	
		ContactName = document.getElementById('Tname').value
	}
	
	
	
	
		if (document.getElementById('Tcountry').value.length == 0)
	{
		document.getElementById('TcountryDiv').innerHTML = '(is Required)'	
		isValid = false ;
		
	}else {
		document.getElementById('TcountryDiv').innerHTML = '';	
		ContactName = document.getElementById('Tcountry').value
	}


		if (document.getElementById('CompanyName').value.length == 0)
	{
		document.getElementById('CompanyNameDiv').innerHTML = '(is Required)'	
		isValid = false ;
		
	}else {
		document.getElementById('CompanyNameDiv').innerHTML = '';	
	}

	
	
	if (document.getElementById('Position').value.length == 0)
	{
		document.getElementById('PositionDiv').innerHTML = '(is Required)'
		isValid = false ;
	}else {
		document.getElementById('PositionDiv').innerHTML = '';	
	}
	
	if (document.getElementById('Tcomment').value.length == 0)
	{
		document.getElementById('TcommentDiv').innerHTML = '(is Required)'	
		isValid = false ;
	}else {
		document.getElementById('TcommentDiv').innerHTML = '';
		PhoneNumber= document.getElementById('Tcomment').value;
	}
		var email = document.getElementById('Temail').value
		AtPos = email.indexOf("@")
		StopPos = email.lastIndexOf(".")

	if (AtPos == -1 || StopPos == -1)
	{
		document.getElementById('TemailDiv').innerHTML = '(Enter a valid email)'	
		isValid = false ;
	}else
	{
		document.getElementById('TemailDiv').innerHTML = '';
		thisemail = email;
	}
	if (isValid == true)
	{	//alert(isValid)
		//sendNewsletter(ContactName,CompanyName,Position,MobileNumber,PhoneNumber,thisemail,Country,Comments)
		document.testForm.submit();
	}else
	{
		//return 	isValid ;
	}
}




function sendNewsletter(ContactName,CompanyName,Position,MobileNumber,PhoneNumber,thisemail,Country,Comments)
{
	fromFlag = 2
	load_str='<table width=100% border=0 cellspacing=0 cellpadding=0><tr bgcolor><td  valign=top width=6><img src=images/spacer.gif height=30 width=1></td><td   valign=top align=center style=padding-top: ><img src=images/ajax-loaderContact.gif?r=1></td><td width=1 valign=top >&nbsp;</td></tr></table>'
	contentObj = document.getElementById('newsletter_loader');
	contentObj.innerHTML = load_str
	//alert('f')
	var poststr = "ContactName="+encodeURI(ContactName)+"&CompanyName="+CompanyName+"&Position="+Position+"&MobileNumber="+MobileNumber+"&PhoneNumber="+PhoneNumber+"&thisemail="+thisemail+"&Comments="+Comments+"&Country="+Country;
	postAjaxFile("_newsletter.asp",poststr);
	

	
}

function sendContact(ContactName,CompanyName,Position,MobileNumber,PhoneNumber,thisemail,Country,Comments){
	fromFlag = 1
	load_str='<table width=100% border=0 cellspacing=0 cellpadding=0><tr bgcolor><td  valign=top width=6><img src=images/spacer.gif height=30 width=1></td><td   valign=top align=center style=padding-top: ><img src=images/ajax-loaderContact.gif?r=1></td><td width=1 valign=top >&nbsp;</td></tr></table>'
	contentObj = document.getElementById('contact_loader');
	contentObj.innerHTML = load_str
	//alert('f')
	var poststr = "ContactName="+encodeURI(ContactName)+"&CompanyName="+encodeURI(CompanyName)+"&Position="+encodeURI(Position)+"&MobileNumber="+encodeURI(MobileNumber)+"&PhoneNumber="+encodeURI(PhoneNumber)+"&thisemail="+encodeURI(thisemail)+"&Comments="+encodeURI(Comments)+"&Country="+encodeURI(Country);
	postAjaxFile("_contactUs.asp",poststr);
	
}

function sendCareer(ContactName,MobileNumber,FatherName,LandlineNumber,UserName,Gender,thisemail,Comments,myCv,jobTitle,title_form_career,TargetJob,TypeJob,COtherJob){
	fromFlag = 3
	load_str='<table width=100% border=0 cellspacing=0 cellpadding=0><tr bgcolor><td  valign=top width=6><img src=images/spacer.gif height=30 width=1></td><td   valign=top align=center style=padding-top: ><img src=images/ajax-loaderContact.gif?r=1></td><td width=1 valign=top >&nbsp;</td></tr></table>'
	contentObj = document.getElementById('career_loader');
	contentObj.innerHTML = load_str
	var poststr = "ContactName="+encodeURI(ContactName)+"&MobileNumber="+encodeURI(MobileNumber)+"&FatherName="+encodeURI(FatherName)+"&LandlineNumber="+encodeURI(LandlineNumber)+"&UserName="+encodeURI(UserName)+"&thisemail="+encodeURI(thisemail)+"&Comments="+encodeURI(Comments)+"&Gender="+encodeURI(Gender)+"&myCv="+encodeURI(myCv)+"&jobTitle="+encodeURI(jobTitle)+"&title_form_career="+encodeURI(title_form_career)+"&TargetJob="+encodeURI(TargetJob)+"&TypeJob="+encodeURI(TypeJob)+"&COtherJob="+encodeURI(COtherJob);
	
	postAjaxFile("_sentCareers.asp",poststr);
	
}
function submitLogin(id){
	
	load_str='<table width=100% border=0 cellspacing=0 cellpadding=0><tr bgcolor><td  valign=top width=6><img src=images/spacer.gif height=30 width=1></td><td   valign=top align=center style=padding-top: ><img src=images/ajax-loaderContact.gif?r=1></td><td width=1 valign=top >&nbsp;</td></tr></table>'
	if (id==1){
		fromFlag = 4
		contentObj = document.getElementById('login_loader');
		UserName = document.getElementById('username_login').value;
		thispassword = document.getElementById('password_login').value;
		}
	else {
		fromFlag = 6
		contentObj = document.getElementById('login_loader1');	
		UserName = document.getElementById('username_login1').value;
		thispassword = document.getElementById('password_login1').value;
		}
	
	contentObj.innerHTML = load_str;
	var poststr = "UserName="+encodeURI(UserName)+"&thispassword="+thispassword;
	postAjaxFile("_login.asp",poststr);
	
}
function sentToFriend(id){
	fromFlag = 5
	//load_str='<table width=100% border=0 cellspacing=0 cellpadding=0><tr bgcolor><td  valign=top width=6><img src=images/spacer.gif height=30 width=1></td><td   valign=top align=center style=padding-top: ><img src=images/ajax-loaderContact.gif?r=1></td><td width=1 valign=top >&nbsp;</td></tr></table>'
	//contentObj = document.getElementById('login_loader');
	//contentObj.innerHTML = load_str;
	MailTo = document.getElementById('MailTo').value;
	MailFrom = document.getElementById('MailFrom').value;
	urlPage = window.location;
	if (MailTo!="" && MailTo!="Friend Email" && MailFrom!="" && MailFrom!="Your Email"){
	var poststr = "MailTo="+encodeURI(MailTo)+"&MailFrom="+MailFrom+"&urlPage="+urlPage;
	postAjaxFile("_tellfriend.asp?id="+id,poststr);
	}
	else {
		document.getElementById("not_message_spot").innerHTML='You must specify the emails';
		}
	}


function passtoFalsh(selectDivID,divid,id){
	document.getElementById(selectDivID).style.backgroundPosition = '0px  0px';
	document.getElementById(divid).style.backgroundPosition = '0px  -26px';
	window.document['teamFlash'].SetVariable("title_team", id);
	//window.document[sid].SetVariable("vid_url", url)

	
	}
function gotoKnow()
{
window.location= 'knowledge_center.asp';
}

function SetValues(e){
      if (!e)
            var e = window.event;

      if (e.pageX || e.pageY) {
            posx = e.pageX;
            posy = e.pageY;
      } else if (e.clientX || e.clientY) {
            posx = e.clientX ;
            posy = e.clientY + (document.documentElement.scrollTop ?document.documentElement.scrollTop :document.body.scrollTop);
			//if (document.body.scrollHeight !=0){posy = posy - e.clientY}
			
			// posy = posy-30
      }
	 posy = posy-432
	 posx = posx+282
   //   alert(posy)
      // posx and posy contain the mouse position relative to the document
      // Do something with this information
      //alert('posX = ' + posx + '\nposY = ' + posy);
		
}

function showPic(toopen,sPicURL)
{

	var exampleFx = new Fx.Morph('slide_image', {
						duration: 1000
					});
	if (toopen == 1)
	{
					
					//sPicURL = document.getElementById('thisPic').value;
					var picUrl ="getImage.aspx?imagename="+ sPicURL +"&width=1000&height=400";
					document.getElementById('display_pic').innerHTML = "<img src='" + picUrl + "' border=0>";
					//$('ContactUsId').setStyle('display','block');
					exampleFx.start({
						'opacity':[0,1]
						//'width':[0,362],
						//'height':[0,420],
						//'top':[posy,posy-407],
						//'left':[posx,posx+100]
						
						//'display:'block
						
						
					});	
	}
	else
	{
		
//					
//					//$('ContactUsId').setStyle('display','block');
//					//document.getElementById("comfirm").style.display='none';
					exampleFx.start({
						'opacity':[1,0]
						//'width':[362,0],
//						//'height':[420,0],
//						//'top':[posy-407,posy],
//						//'left':[posx+100,posx]
//						
//						//'display:'block
//						
//						
				});	
			//alert('d')
			 setTimeout(hidePage,1010);
		
	}
//	
	//document.getElementById('displayFields').style.display = 'block';
}
