

var browser=navigator.appName;
var version=navigator.appVersion;
var index=version.lastIndexOf("Safari");


var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)

{

  if(popUpWin)

  {

    if(!popUpWin.closed) popUpWin.close();

  }

  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');

}

function CareersPage(){
		//alert('roger')
		popUpWindow("SakrWS/index.html",200,200,950,595)
		
}

var xmlhttp;
function loadXMLDoc(url)
{

xmlhttp=null;
if (window.XMLHttpRequest)
  {// code for Firefox, Opera, IE7, etc.
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
if (xmlhttp!=null)
  {
	url=url+'&'+Math.random();	  
  xmlhttp.onreadystatechange=state_Change;
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
  }
else
  {
  alert("Your browser does not support XMLHTTP.");
  }
}

function state_Change()
{
if (xmlhttp.readyState==4)
  {// 4 = "loaded"
  if (xmlhttp.status==200)
    {// 200 = "OK"
    //text=xmlhttp.responseText;
	//alert(AT.ishover+','+AT.oktomove);
	//if(AT.ishover==true && AT.oktomove==true){
	writetxt(xmlhttp.responseText);
	}
   // }getElementById - MDC
 else
    {
		alert(xmlhttp.responseText)
    alert("Problem retrieving data:" + xmlhttp.statusText);
	
    }
  }
}
function writetxt(str){
	document.getElementById(id).innerHTML=str;

}

function getRange(prdBrandid,catid){
		id='RangePrd';
		prdBrandid=prdBrandid;
		//alert(ProductTypeId);
	  writetxt('<table width=100% border=0 cellspacing=0 cellpadding=0><tr bgcolor><td  valign=top width=6><img src=images/spacer.gif height=60 width=1></td><td   valign=top align=center><img src=images/loading_ani2.gif?r=1></td><td width=1 valign=top >&nbsp;</td></tr></table>');
	 // var fulldate=new Date(Date.parse(date));
	 // var Sday=fulldate.getDate();
	 // var Eday=Sday-1;
	 // var Emonth=fulldate.getMonth();
	 // var Eyear=fulldate.getFullYear();
	  //ThisDate=Sday+'%2F'+Emonth+'%2F'+Eyear
	 // alert(thisdate)
	// alert(catid)
	  loadXMLDoc('getRange.asp?prdBrandid='+prdBrandid+'&thisbrowser='+browser+'&catid='+catid);	
}




function MakeGrisMain() {

	if (browser=="Microsoft Internet Explorer")  {
		document.getElementById('pages').style.filter='progid:DXImageTransform.Microsoft.Alpha( style=0,opacity=58)';
		//document.getElementById('footer').style.filter='progid:DXImageTransform.Microsoft.Alpha( style=0,opacity=58)';
	}
    if (browser=="Netscape") {
	    if (index != - 1) {
			document.getElementById('pages').style.opacity =0.58;
			 
		}
		else {
			document.getElementById('pages').style.MozOpacity=0.58	;
			 
		}
	}
}

function framSrs(url){
	document.getElementById('SrsIframe').src=url
	
}

function HidePage(divid) {
	document.getElementById(divid).style.display= 'none';
	RemoveGrisMain();
/*	for (i=0; i<document.all.length; i++) {
    	document.all(i).unselectable = "off";
  	}
*/}
function RemoveGrisMain() {
	if (browser=="Netscape") {
		if (index != - 1){
			document.getElementById('pages').style.opacity =1;
			}
		else{
			document.getElementById('pages').style.MozOpacity=1	;   //this line remove the background 	
			}  //this line remove the background 	
	}
	
	if (browser=="Microsoft Internet Explorer") {
		document.getElementById('pages').style.filter='progid:DXImageTransform.Microsoft.Alpha( style=0,opacity=100)';   //this line remove the background 	
		//document.getElementById('footer').style.filter='progid:DXImageTransform.Microsoft.Alpha( style=0,opacity=100)';   //this line remove the background 	
	}
}
function showPage2() {
	document.getElementById('divDrag2').style.display='block';	 
}
function HidePage2() {
	document.getElementById('divDrag2').style.display= 'none';	
}
function openNewsLetter() {
	//emailDownLetter1=document.getElementById('emailDownLetter').value;
	//document.FormLetter.reset();  //this line to delete all data entered if we opened it another time.it will clear all fields in elements entered.
	//document.getElementById('sendMessage').innerHTML="";
	//document.getElementById('emailLetter').value=emailDownLetter1;
	
	if (document.getElementById('wrapper') != null )
	document.getElementById('divDrag2').style.height=document.getElementById('wrapper').offsetHeight+"px"; 
	document.getElementById('conttainerPoUp').style.display='block'//27 px height of the bottom div
	//if (document.getElementById('centerTableSub') != null )
	//document.getElementById('divDrag2').style.height=document.getElementById('centerTableSub').offsetHeight+bottomHeight+"px";   //27 px height of the bottom div

	showPage2();
}
function hilightDiv(id){
	var id=id;
	document.getElementById('LabelMenu'+id).style.backgroundColor='#CFD6DC';
	document.getElementById('arrow'+id).style.backgroundColor='#CFD6DC';
	document.getElementById('locationDetal'+id).style.display='block';
	document.getElementById('LabelMenu'+id).className='LabelMenu whiteTahoma15 ';
	
	
}

function blurDiv(id){
	var id=id;
	document.getElementById('LabelMenu'+id).style.backgroundColor='';
	document.getElementById('arrow'+id).style.backgroundColor='';
	document.getElementById('locationDetal'+id).style.display='none';
	document.getElementById('LabelMenu'+id).className='LabelMenu tahoma14 ';
}
function PassDate(titleAbout){
	//alert(titleAbout)
	window.document["topRightCalender"].SetVariable("title",titleAbout);
}

function NextDate(flag){
aideValeur=document.getElementById('Nextcal').value;
Update(aideValeur,flag);
 
}
function PreviousDate(flag){
aideValeur=document.getElementById('previouscal').value;
Update(aideValeur,flag);
}
function Update(id,flag) {
    contentObj=document.getElementById('CalanderId');
	getAjaxFile('calendarexample.asp?flag='+flag+'&date='+id+'&rnd='+Math.random());
}
function InitHeightScroll() {
	
//
	if (browser=="Microsoft Internet Explorer")  {
			
				//alert("roger2")
	}

    if (browser=="Netscape") {
	    if (index != - 1) {
			//document.getElementById('khv-height').innerHTML="422";
	
							

		}
		else {
			//document.getElementById('khv-height').innerHTML="422";	
			//	alert('rotger1');
				document.getElementById('titeImage').style.paddingLeft='6px';	
		}
	}
	
		 
	
}
function handleSelectBox(first,second) {
		
//
	if (browser=="Microsoft Internet Explorer")  {
	
		document.getElementById('covDiv1').style.display='none';
		document.getElementById('covDiv2').style.display='none';

				//alert("roger2")
	}

    if (browser=="Netscape") {
	//	alert(second)
	    if (index != - 1) {
			//document.getElementById('khv-height').innerHTML="422";
			if (first>=6){
				
				document.getElementById('covDiv1').style.display='none';
			}
				
				
			if (second >=6){
				
				document.getElementById('covDiv2').style.display='none';
			}else{
				//alert('fd')
				document.getElementById('findid').style.paddingRight='16px';
				document.getElementById('findid').style.backgroundColor='#ff00';
				}
				
				//alert('');		

		}
		else {
			//document.getElementById('khv-height').innerHTML="422";	
			//	alert('rotger1');
if (first>=6){
				
				document.getElementById('covDiv1').style.display='none';
			}
				
				
			if (second>=6){
				
				document.getElementById('covDiv2').style.display='none';
			}else{
				//alert('fd')
				document.getElementById('findid').style.paddingRight='16px';
				//document.getElementById('findid').style.backgroundColor='#ff00';
				}
				//document.getElementById('titeImage').style.paddingLeft='6px';	
		}
	}
	
		 
	
}
