function ChangeToSelect(menu,class1,pic,class2){
document.getElementById(menu).className=class1;
document.getElementById(pic).className=class2;
	}
function ShowPic(id,NewPic){
document.getElementById(id).style.display='block';	
document.getElementById(id+'M').style.backgroundImage='url(images/'+NewPic+'.gif)'
	}
function HidePic(id,OldPic){
document.getElementById(id).style.display='none';	
document.getElementById(id+'M').style.backgroundImage='url(images/'+OldPic+'.gif)'
	}
function HidePic1(id,OldPic){
document.getElementById(id).style.display='none';	
	}

var browser=navigator.appName;
var version=navigator.appVersion;
var index=version.lastIndexOf("Safari");

function  overGrid() {
	 		   valeur=document.getElementById('contentLatestNews').offsetHeight;
		   
		   valeur=parseInt(valeur)+40;
		   //document.getElementById('topRightNews').className="infoCover1";
		   document.getElementById('myOtherElement').className="borderElement";
				document.getElementById('myOtherElement').set('tween', {
				duration: 1000,
				bounce: Fx.Transitions.Bounce.out // This could have been also 'bounce:out'
				
			}).tween('height', valeur+'px');
}
function  outGrid() {
	 		// Resets the tween and changes the element back to its original size
			document.getElementById('myOtherElement').set('tween', {}).tween('height', '1px');
			// document.getElementById('topRightNews').className="infoCover";
			 document.getElementById('myOtherElement').className="";


 			//document.getElementById("contactrightID").style.display="none";
}
//var isPageLoaded ;
//isPageLoaded="";

function gotNewsPage() {
   currentIdNews1=document.getElementById("currentIdNews").value;
   window.location=""+currentIdNews1;
}
function gotoMainPage() {
   myslidePictureId1=document.getElementById("myslidePictureId").value;
   window.location=""+myslidePictureId1;
}
function gotoPage() {
   myslidePictureId1=document.getElementById("myslidePictureId").value;
   window.location="pages.asp?articleId="+myslidePictureId1;
}
function updateClock ( )
{
  var currentTime = new Date ( );

  var currentHours = currentTime.getHours ( );
  var currentMinutes = currentTime.getMinutes ( );
  var currentSeconds = currentTime.getSeconds ( );

  // Pad the minutes and seconds with leading zeros, if required
  currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
  currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;

  // Choose either "AM" or "PM" as appropriate
  var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";

  // Convert the hours component to 12-hour format if needed
  currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;

  // Convert an hours component of "0" to "12"
  currentHours = ( currentHours == 0 ) ? 12 : currentHours;

  // Compose the string for display
  var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + timeOfDay;

  // Update the time display
  document.getElementById("clock").innerHTML= currentTimeString;
}


function sendUser() {
  document.registerForm.submit();
}
function loadAllPics() {
simplePreload("images/abrajLaha.gif","images/abrajLahaS.gif","images/thakafa.gif","images/thakafaS.gif","images/safar.gif","images/safarS.gif","images/dikour.gif","images/dikourS.gif","images/mougtama3.gif","images/mougtama3S.gif","images/a3ras.gif","images/a3rasS.gif","images/oumahat.gif","images/oumahatS.gif","images/sou7a.gif","images/sou7aS.gif","images/rachaka.gif","images/rachakaS.gif","images/mousta7darat.gif","images/mousta7daratS.gif","images/jamale.gif","images/jamaleS.gif","images/mouda.gif","images/moudaS.gif","images/noujoumMachir.gif","images/noujoumMachirS.gif","images/ajax-loaderN.gif","images/ajax-loaderN3.gif","images/previousAdviceOff.gif","images/nextAdvice.gif","images/nextAdviceOff.gif","images/previousAdvice.gif");	
//isPageLoaded="1";
}
function loadPicsKawalis() {
simplePreload("images/StudioFanrollover.png","images/star academy rollover.png","images/taratatarollover.png","images/NajemKhalij.png","images/NajemKhalijrollover.png","images/Taratata2.png","images/Taratatarollover2.png","images/StudioFan2.png","images/StudioFanrollover2.png","images/starAcademy2.png","images/starAcademyrollover2.png");	
//isPageLoaded="1";
}
function changePicNews(id) {
	  picName=document.getElementById('latestNewsPic'+id).value;
	  document.getElementById("currentIdNews").value=document.getElementById("latestIPic"+id).value    
	  
	  aideLatestNombre=document.getElementById('counterLatest').value;
	  document.getElementById("imgLatestNews").style.backgroundImage='url('+picName+')';
	  //document.getElementById("lahaMainLatest").src="getImage.aspx?imagename="+picName+"&width=190&height=1000";
	  for (i=0;i<aideLatestNombre;i++) {
		document.getElementById('titleMainLatest'+i).className="titlearticleLatest1";	  
  		document.getElementById('latestDescription'+i).className="descArticleLatest";	  
	  }
	  document.getElementById('titleMainLatest'+id).className="titlearticleLatest";
	  document.getElementById('latestDescription'+id).className="descArticleLatest1";	  
}
function changesubPicNews(id) {
	  picName=document.getElementById('latestNewsPic'+id).value;
	  aideLatestNombre=document.getElementById('counterLatest').value;
	  document.getElementById("imgLatestNews").style.backgroundImage='url(images/ajax-loaderN.gif)';
															 
	  document.getElementById("imgLatestNews").style.backgroundImage='url(getImage.aspx?imagename='+picName+'&width=190&height=1000)';
	  for (i=0;i<=aideLatestNombre;i++) {
		document.getElementById('titleMainLatest'+i).className="Newtahoma11gris";	  
	  }
	  document.getElementById('titleMainLatest'+id).className="tahoma11grisblod";	  
}
function removeClass(id) {
	  document.getElementById('titleMainLatest'+id).className="titlearticleLatest1";	  	
}
function exportCover() {
	document.getElementById('myOwnCover').innerHTML="<img src=images/ajax-loaderN.gif border=0   >";
	contentObj=document.getElementById('myOwnCover');	
	getAjaxFile('_LatestCover.asp?rnd='+Math.random());	
}
/*function gibLeftWeather(id,countryName) {
	    document.getElementById('leftinfoWeather').innerHTML="<div style='position:relative;padding-left:55px;'><img src=images/ajax-loaderN.gif border=0   ></div>";
		contentObj=document.getElementById('leftinfoWeather');
		document.getElementById('leftdescWeather').innerHTML=countryName;
		getAjaxFile('LeftmainWeather.asp?countryCode='+id+'&rnd='+Math.random());	
		closeCountry();
}*/

function gibWeather(id,countryName) {
	    document.getElementById('infoWeather').innerHTML="<div style='width:100px;padding-right:173px;'><img src=images/ajax-loaderN.gif border=0   ></div>";
		contentObj=document.getElementById('infoWeather');
		document.getElementById('descWeather').innerHTML=countryName;
		getAjaxFile('mainWeather.asp?countryCode='+id+'&rnd='+Math.random());	
		closeCountry();
}

function previousMouda() {
	maxMouda1=document.getElementById("maxMouda").value;	
	startMouda1=document.getElementById("startMouda").value;
	
	if (parseInt(startMouda1) > 0 )  {
        //switchImage("idMoudaPrevious","images/previousMouda.png");
		LbondPosition=parseInt(startMouda1)-1;
	    document.getElementById('boxMouda').innerHTML="<div style='position:relative;height:156px;padding-top:80px; padding-right:59px;text-align:right;'><img src=images/Rajax-loader.gif border=0   ></div>";		
		contentObj=document.getElementById('boxMouda');	
		getAjaxFile8('_moudaLaha.asp?LbondPosition='+LbondPosition+'&rnd='+Math.random());
	}	 
}


function moreMouda() {
	maxMouda1=document.getElementById("maxMouda").value;	
	startMouda1=document.getElementById("startMouda").value;
	if (parseInt(startMouda1) <= parseInt(maxMouda1)-1 )  {
		//switchImage("idMoudaNext","images/nextMouda.png");
 		LbondPosition=parseInt(startMouda1)+1;
	    document.getElementById('boxMouda').innerHTML="<div style='position:relative;height:156px;padding-top:80px; padding-right:59px;text-align:right;'><img src=images/Rajax-loader.gif  border=0   ></div>";		
		contentObj=document.getElementById('boxMouda');	
		getAjaxFile8('_moudaLaha.asp?LbondPosition='+LbondPosition+'&rnd='+Math.random());
	}  
}

function StatusMouda() {
	maxMouda1=document.getElementById("maxMouda").value;	
	startMouda1=document.getElementById("startMouda").value;	
	
	if (parseInt(startMouda1) == 0 )  {
	     switchImage("idMoudaPrevious","images/previousMouda.png");
		 switchImage("idMoudaNext","images/nextMoudaOff.png");
		 
		 
 	}
	else {
		//switchImage("idMoudaPrevious","images/previousMouda.png");
		if (parseInt(startMouda1) == parseInt(maxMouda1)  ) {
			switchImage("idMoudaPrevious","images/previousMoudaOff.png");
			switchImage("idMoudaNext","images/nextMouda.png");
		}
		else {
			switchImage("idMoudaNext","images/nextMouda.png");
		}	
	}
	
	
}

function previousNVersion() {
	maxNewStyle1=document.getElementById("maxNewStyle").value;	
	startNewStyle1=document.getElementById("startNewStyle").value;
	
	if (parseInt(startNewStyle1) > 0 )  {
        //switchImage("IdLahaPreviousLaha","images/Previous.gif");
		LbondPosition=parseInt(startNewStyle1)-1;
	    document.getElementById('comboNewLaha').innerHTML="<div style='position:relative;width:80px;height:140px;padding-left:57px;padding-top:37px;'><img src=images/ajax-loaderN.gif border=0   ></div>";
		contentObj=document.getElementById('comboNewLaha');	
		getAjaxFile7('_versionNew.asp?LbondPosition='+LbondPosition+'&rnd='+Math.random());
	}	 
}


function moreNVersion() {
	maxNewStyle1=document.getElementById("maxNewStyle").value;	
	startNewStyle1=document.getElementById("startNewStyle").value;
	if (parseInt(startNewStyle1) <= parseInt(maxNewStyle1)-1 )  {
		//switchImage("IdLahaNextLaha","images/next.gif");
 		LbondPosition=parseInt(startNewStyle1)+1;
	    document.getElementById('comboNewLaha').innerHTML="<div style='position:relative;width:80px;height:140px;padding-left:57px;padding-top:37px;'><img src=images/ajax-loaderN.gif  border=0   ></div>";
		contentObj=document.getElementById('comboNewLaha');	
		getAjaxFile7('_versionNew.asp?LbondPosition='+LbondPosition+'&rnd='+Math.random());
	}  
}


function StatusNewLaha() {
	maxNewStyle1=document.getElementById("maxNewStyle").value;	
	startNewStyle1=document.getElementById("startNewStyle").value;	
	
if (parseInt(startNewStyle1) == 0 )  {
	    switchImage("IdLahaNextLaha","images/previous.gif");
		switchImage("IdLahaPreviousLaha","images/nextOff.gif"); 
}
else {
		//switchImage("IdLahaNextLaha","images/previous.gif");
		//switchImage("IdLahaPreviousLaha","images/next.gif");
		if (parseInt(startNewStyle1) == parseInt(maxNewStyle1)  ) {
			switchImage("IdLahaNextLaha","images/previousOff.gif");
			switchImage("IdLahaPreviousLaha","images/next.gif");
		}
		else {
			switchImage("IdLahaNextLaha","images/previous.gif");
			switchImage("IdLahaPreviousLaha","images/next.gif");
		}
}

	
}







function previousAdvice() {
	maxLifePosition1=document.getElementById("maxLifePosition").value;	
	startLifePosition1=document.getElementById("startLifePosition").value;
	endLifePosition1=document.getElementById("endLifePosition").value;	
	if (parseInt(startLifePosition1) > 0 )  {
		//document.getElementById("adviceIdPrev").className="previousAdvices";
		LbondPosition=parseInt(startLifePosition1)-6;
		UbondPosition=parseInt(startLifePosition1)-1;
	    document.getElementById('myOwnComboId').innerHTML="<div style='position:relative;width:80px;height:81px;padding-right:180px;'><img src=images/ajax-loaderN.gif  border=0   ></div>";		
		contentObj=document.getElementById('myOwnComboId');	
		getAjaxFile5('_Advices.asp?LbondPosition='+LbondPosition+'&UbondPosition='+UbondPosition+'&rnd='+Math.random());
	}	 
}
function moreAdvices() {
	maxLifePosition1=document.getElementById("maxLifePosition").value;	
	startLifePosition1=document.getElementById("startLifePosition").value;
	endLifePosition1=document.getElementById("endLifePosition").value;	
	
	if (parseInt(endLifePosition1) < parseInt(maxLifePosition1) )  {
		//document.getElementById("adviceIdNext").className="nextAdvices";
 		LbondPosition=parseInt(endLifePosition1)+1;
		UbondPosition=parseInt(endLifePosition1)+6;
		if ( parseInt(UbondPosition) > parseInt(maxLifePosition1) ) {
			 UbondPosition=parseInt(maxLifePosition1);
		}
	    document.getElementById('myOwnComboId').innerHTML="<div style='position:relative;width:80px;height:81px;padding-right:180px;'><img src=images/ajax-loaderN.gif  border=0   ></div>";		
		contentObj=document.getElementById('myOwnComboId');	
		getAjaxFile5('_Advices.asp?LbondPosition='+LbondPosition+'&UbondPosition='+UbondPosition+'&rnd='+Math.random());
	}  
}
function StatusLife() {
	//alert("elias 1");
	maxLifePosition1=document.getElementById("maxLifePosition").value;	
	startLifePosition1=document.getElementById("startLifePosition").value;
	endLifePosition1=document.getElementById("endLifePosition").value;
	if (parseInt(startLifePosition1) == 0 )  {
    	document.getElementById("adviceIdNext").className="nextAdvicesOff";
		document.getElementById("adviceIdPrev").className="previousAdvices";
	}
	else {
		//document.getElementById("adviceIdPrev").className="previousAdvices";
		if (parseInt(endLifePosition1) == parseInt(maxLifePosition1)  ) {
			document.getElementById("adviceIdNext").className="nextAdvices";
		    document.getElementById("adviceIdPrev").className="previousAdvicesOff";
		}
		else {
			document.getElementById("adviceIdNext").className="nextAdvices";
		    document.getElementById("adviceIdPrev").className="previousAdvices";
			//document.getElementById("adviceIdNext").className="nextAdvices";
		}
	}
}

function Statusweek() {
 	maxweekly1=document.getElementById("maxweekly").value;	
	startweekly1=document.getElementById("startweekly").value;
	endweekly1=document.getElementById("endweekly").value;
	if (parseInt(startweekly1) == 0 )  {
			document.getElementById("weeklyNext").className="nextWeekOff";
			document.getElementById("weeklyPrevious").className="previousWeek";
	}
	else {
		//document.getElementById("weeklyPrevious").className="previousWeek";
		if (parseInt(endweekly1) == parseInt(maxweekly1)  ) {
    		document.getElementById("weeklyNext").className="nextWeek";
			document.getElementById("weeklyPrevious").className="previousWeekOff";
		}
		else {
		    document.getElementById("weeklyNext").className="nextWeek";
			document.getElementById("weeklyPrevious").className="previousWeek";
		}
		
		
	}

}

function previousWeeks() {
	maxweekly1=document.getElementById("maxweekly").value;	
	startweekly1=document.getElementById("startweekly").value;
	endweekly1=document.getElementById("endweekly").value;
 	if (parseInt(startweekly1) > 0 )  {
		//document.getElementById("weeklyPrevious").className="previousWeek";
		LbondPosition=parseInt(startweekly1)-2;
		UbondPosition=parseInt(startweekly1)-1;
		document.getElementById('comboPicWeeks').innerHTML="<div style='position:relative;width:80px;padding-top:80px; padding-right:215px;'><img src=images/Rajax-loaderN.gif  border=0   ></div>";
		contentObj=document.getElementById('comboPicWeeks');	
		getAjaxFile6('_Weeklies.asp?LbondPosition='+LbondPosition+'&UbondPosition='+UbondPosition+'&rnd='+Math.random());
	}
}
function moreWeeks() {
	maxweekly1=document.getElementById("maxweekly").value;	
	startweekly1=document.getElementById("startweekly").value;
	endweekly1=document.getElementById("endweekly").value;	
 	if (parseInt(endweekly1) <= parseInt(maxweekly1)-1 )  {
		//document.getElementById("weeklyNext").className="nextWeek";
 		LbondPosition=parseInt(endweekly1)+1;
		UbondPosition=parseInt(endweekly1)+2;
		document.getElementById('comboPicWeeks').innerHTML="<div style='position:relative;width:80px;padding-top:80px; padding-right:215px;'><img src=images/Rajax-loaderN.gif  border=0   ></div>";
		contentObj=document.getElementById('comboPicWeeks');	
		getAjaxFile6('_Weeklies.asp?LbondPosition='+LbondPosition+'&UbondPosition='+UbondPosition+'&rnd='+Math.random());
	}
}

function insertBourij(id,titleBourij) {
    valeurBourij=document.getElementById("abrajDesc"+id).value;
	logoCurrent=document.getElementById("imgLogo"+id).value;
	switchImage("bourijLogoImg","images/"+logoCurrent);
	document.getElementById("mydescBourij").innerHTML=valeurBourij;
	document.getElementById("horoscopesInput").value=titleBourij;
	document.getElementById("IdHoroscopesMain").style.display="none";	  
}

function openBourij(id) {
   if (document.getElementById(id).style.display== "none"	) {
   		document.getElementById(id).style.display="block";	   
   }
   else {
		document.getElementById(id).style.display="none";	   
   }
}

function changeRightTitle() {
	 brokenCover1=document.getElementById('brokenCover').value;
 	 window.document["rightTitleFlash1"].SetVariable("title", brokenCover1);
}
function PreviousCover() {
  maxCovers1=document.getElementById('maxCovers').value;
  sommeCovers1=document.getElementById('sommeCovers').value;
  maxCovers1=parseInt(maxCovers1)+1;


  
  if (parseInt(maxCovers1) <= parseInt(sommeCovers1) ) {
	      document.getElementById('AjaxLeftMenu').innerHTML="<table height=100% width=100% border=0 cellspacing=0 cellpadding=0  ><tr><td style=height:100%><table style=height:100% align=center border=0 cellspacing=0 cellpadding=0><tr><Td style=height:100% align=center valign=middle><img src=images/Newloading_Pop.gif?11 border=0    ></td></tr></table></td></tr></table>";
 	  contentObj=document.getElementById('AjaxLeftMenu');
	  getAjaxFile4('newCover.asp?currentCover='+maxCovers1+'&rnd='+Math.random());
	  
  }
  else {
	  if (maxCovers1 > sommeCovers1 )
	  maxCovers1=sommeCovers1;
  }
 document.getElementById('maxCovers').value=maxCovers1;

}
function NextCover() {
  maxCovers1=document.getElementById('maxCovers').value;
  sommeCovers1=document.getElementById('sommeCovers').value;
  maxCovers1=parseInt(maxCovers1)-1;
  
  if (parseInt(maxCovers1) >= 0 ) {
	  	      document.getElementById('AjaxLeftMenu').innerHTML="<table height=100% width=100% border=0 cellspacing=0 cellpadding=0    ><tr><td style=height:100%><table style=height:100% align=center border=0 cellspacing=0 cellpadding=0><tr><Td style=height:100% align=center valign=middle><img src=images/Newloading_Pop.gif?11 border=0    ></td></tr></table></td></tr></table>";
	  contentObj=document.getElementById('AjaxLeftMenu');
	  getAjaxFile4('newCover.asp?currentCover='+maxCovers1+'&rnd='+Math.random());
  }
  else { 
      if (maxCovers1 < 0 ) {
	      maxCovers1=0;
	  }
  	  //alert("This is the Newest Cover");
  }
  document.getElementById('maxCovers').value=maxCovers1;
}

function simplePreload()

{ 
  var args = simplePreload.arguments;

  document.imageArray = new Array(args.length);

  for(var i=0; i<args.length; i++)

  {
    
    document.imageArray[i] = new Image;

    document.imageArray[i].src = args[i];

  }

}

function openPassword() {
	document.getElementById('iframe1').height="700";
	document.getElementById('iframe1').width="100%";
	document.getElementById('iframe1').src="loading.html?rnd="+Math.random();
	document.getElementById('iframe1').src="forgotPass.asp"
	document.getElementById('divDrag').style.height=document.getElementById('CenterPage').offsetHeight +"px"
    showPage();
}


function openRegsiter(id) {
	document.getElementById('iframe1').height="700";
	document.getElementById('iframe1').width="100%";
	document.getElementById('iframe1').src="loading.html?rnd="+Math.random();
	document.getElementById('iframe1').src="logIn.asp?fromCook="+id
	document.getElementById('divDrag').style.height=document.getElementById('CenterPage').offsetHeight +"px"
    showPage();
}

function openFailed(id) {
	document.getElementById('iframe1').height="700";
	document.getElementById('iframe1').width="100%";
	document.getElementById('iframe1').src="loading.html?rnd="+Math.random();
	document.getElementById('iframe1').src="logIn.asp?logIn=1&fromCook="+id
	document.getElementById('divDrag').style.height=document.getElementById('CenterPage').offsetHeight +"px"
    showPage();
}

function openFacebook(id) {
	//alert("elias="+window.location)
	//document.getElementById('iframe1').height="100%";
	//document.getElementById('iframe1').width="100%";
	//document.getElementById('iframe1').src="loading.html?rnd="+Math.random();
	///document.getElementById('iframe1').src="friends.asp?articleId="+id;
	//document.getElementById('divDrag').style.height=document.getElementById('CenterPage').offsetHeight +"px"
    // showPage();
    popUpWindow("friends.asp?articleId="+id,30,30,900,850);
}

function openNewVideo(url,id){
	scroll(0,0);
	document.getElementById('iframe2').height="545px";
	document.getElementById('iframe2').width="550px";
	document.getElementById('iframe2').src="loading.html?rnd="+Math.random();
	document.getElementById('iframe2').src="NewVideo.asp?id="+id+"&vid="+url+"&color=#00FF99";
	document.getElementById('divDrag1').style.height=document.getElementById('CenterPage').offsetHeight +"px";
    document.getElementById('divDrag1').style.display='block';
	}
	
function openVideo(url) {
 	document.getElementById('iframe1').height="100%";
	document.getElementById('iframe1').width="100%";
	colorPageToken1=document.getElementById('colorPageToken').value;
	document.getElementById('iframe1').src="loading.html?rnd="+Math.random();
	document.getElementById('iframe1').src="video.asp?urlvideo="+url+"&colorPageToken="+colorPageToken1
	document.getElementById('divDrag').style.height=document.getElementById('CenterPage').offsetHeight +"px"
    showPage();
}

function HidePage() {
	document.getElementById('divDrag').style.display= 'none';
	document.getElementById('iframe1').src="loading.html?rnd="+Math.random();
}
function HidePage2() {
	document.getElementById('divDrag1').style.display= 'none';
	document.getElementById('iframe2').src="loading.html?rnd="+Math.random();
}

function showPage() {
	document.getElementById('divDrag').style.display='block';
}
function changeDescription() {
	mySlideDesc1=document.getElementById("mySlideDesc").value;
	document.getElementById("DescImageSlide").innerHTML=mySlideDesc1;
}

function ShowComment(id) {
	document.getElementById(id).style.display="block";	
}
function HideComment(id) {
	document.getElementById(id).style.display="none";	
}
function slidefunction(id) {

if (document.getElementById("defaultSilde").value != "") {	
     
   alphaClsElias=document.getElementById("alphaCls"+id).value;	
	if (document.getElementById('mb'+alphaClsElias+'1') != null) {
 		openSlideShow(document.getElementById('mb'+alphaClsElias+'1'),id);
	}
}
else {
    alphaClsElias=document.getElementById("alphaCls1").value;	
	if (document.getElementById('mb'+alphaClsElias+id) != null) {
 		openSlideShow(document.getElementById('mb'+alphaClsElias+id),1);
	}
}

}


function slideNewInner(id,startFrom) {

if (document.getElementById("defaultSilde").value != "") {	
     
   alphaClsElias=document.getElementById("alphaCls"+id).value;	
	if (document.getElementById('mb'+alphaClsElias+startFrom) != null) {
 		openSlideShow(document.getElementById('mb'+alphaClsElias+startFrom),id);
	}
}
else {
    alphaClsElias=document.getElementById("alphaCls1").value;	
	if (document.getElementById('mb'+alphaClsElias+id) != null) {
 		openSlideShow(document.getElementById('mb'+alphaClsElias+id),1);
	}
}

}

function StartNewClassic(id) {

if (document.getElementById("defaultSilde").value != "") {	
   if (document.getElementById('mbAllPP1') != null) {
		eliasSomme=document.getElementById("sommeAllCategories").value;
  		openSlideShow(document.getElementById('mbAllPP1'),eliasSomme);
   }
}
else {
    alphaClsElias=document.getElementById("alphaCls1").value;	
	if (document.getElementById('mb'+alphaClsElias+id) != null) {
 		openSlideShow(document.getElementById('mb'+alphaClsElias+id),1);
	}
}

}


function slidefunction1() {
aideNombre=document.getElementById('startFomSlide').value;	
//alphaClsElias=document.getElementById("alphaCls"+id).value;
 if (document.getElementById("defaultSilde").value != "") {	
	alphaClsElias=document.getElementById("alphaCls1").value;	
	if (document.getElementById('mb'+alphaClsElias+aideNombre) != null)
	openSlideShow(document.getElementById('mb'+alphaClsElias+aideNombre),aideNombre);
}
else {
    alphaClsElias=document.getElementById("alphaCls1").value;
	if (document.getElementById('mb'+alphaClsElias+aideNombre) != null)
	openSlideShow(document.getElementById('mb'+alphaClsElias+aideNombre),aideNombre);
}

  
}
function InsertChosen(nameLaha,IdLaha) {
  document.getElementById('searchNameTop').value=nameLaha;
  document.getElementById('searchIdField').value=IdLaha;
  HideAllLayers();
}
function setWeidth(id,id2) {
 
	 window.document[id2].setAttribute('width', id);
	 
 }

function openCareer(id) {
	document.getElementById('iframe1').height="100%";
	document.getElementById('iframe1').width="100%";
	document.getElementById('iframe1').src="loading.html?rnd="+Math.random();
	document.getElementById('iframe1').src="careersPop.asp?id="+id;
	document.getElementById('divDrag').style.height=document.getElementById('CenterPage').offsetHeight +"px"
    showPage();
 
}
function showPage() {
	document.getElementById('divDrag').style.display='block';
}

function HidePage() {
   // document.getElementById('iframe1').src="loading.html?rnd="+Math.random();
	document.getElementById('divDrag').style.display= 'none';
	//document.getElementById('iframe1').src="loading.html?rnd="+Math.random();
	//RemoveGrisMain();
	for (i=0; i<document.all.length; i++) {
    	document.all(i).unselectable = "off";
  	}
	
}

function ChoosecookPoint(fromId) {
	      
	     if (fromId % 2  == 0)  {
	     	undoFelias=(parseInt(fromId)+1);
		    //undoCat=parseInt(fromId)-1
		 }
		 else { 
		    undoFelias=(parseInt(fromId)-1);
			//undoCat=parseInt(fromId)+1
		 }
		 
	     myArticle2=document.getElementById('rightTitle'+fromId).value;
		 myArticle1=document.getElementById('rightTitle'+undoFelias).value;
 		 
		 
 
 		  if (parseInt(document.getElementById('choosenResult'+fromId).value) == 1) {
			   document.getElementById('choosenResult'+fromId).value=2;
			   if (fromId % 2  == 0)  {
			   		aideIdCategory=document.getElementById('IdMainCategory'+(parseInt(fromId)+1)).value;
			   }
			   else{
			        aideIdCategory=document.getElementById('IdMainCategory'+fromId).value;
			   }
			   LatestCooks(aideIdCategory,fromId);  
 			   window.document["rightTitleFlash"+undoFelias].SetVariable("title", myArticle1);
			   window.document["rightTitleFlash"+fromId].SetVariable("title", myArticle2);
 		  }
	
		else  { 
			   document.getElementById('choosenResult'+fromId).value=1;
			   if (fromId % 2  == 0)  {
			   		aideIdCategory=document.getElementById('IdMainCategory'+fromId).value;
			   }
			   else{
			        aideIdCategory=document.getElementById('IdMainCategory'+(parseInt(fromId)-1)).value;
			   }
	           LatestCooks(aideIdCategory,fromId);
			   window.document["rightTitleFlash"+undoFelias].SetVariable("title", myArticle2);
			   window.document["rightTitleFlash"+fromId].SetVariable("title", myArticle1);
	     }
 
 
}

function ChooseLeftPoint(fromId) {

 
	     myArticle2=document.getElementById('rightTitle2').value;
		 myArticle1=document.getElementById('rightTitle1').value;
 		 if (parseInt(document.getElementById('choosenResult').value) == 1) {
			   document.getElementById('choosenResult').value=2;
 			   document.getElementById('firstTd1').className="colorWhite";
			   document.getElementById('firstTd2').className="colorWhite";
			   document.getElementById('firstTd3').className="colorWhite";
			   document.getElementById('firstTd4').className="colorWhite";
			   LatestNews("2",fromId);  
 			   window.document["rightTitleFlash1"].SetVariable("title", myArticle2);
			   window.document["rightTitleFlash2"].SetVariable("title", myArticle1);
			   document.getElementById('MainLatestId').className="colorWhite";
			   
 		  }
	
		else  { 
		        document.getElementById('choosenResult').value=2;
 			   document.getElementById('firstTd1').className="otherColor";
			   document.getElementById('firstTd2').className="otherColor";
			   document.getElementById('firstTd3').className="otherColor";
			   document.getElementById('firstTd4').className="otherColor";
			   document.getElementById('choosenResult').value=1;
	           LatestNews("1",fromId);
			   window.document["rightTitleFlash2"].SetVariable("title", myArticle2);
			   window.document["rightTitleFlash1"].SetVariable("title", myArticle1);
			   document.getElementById('MainLatestId').className="otherColor";

	     }
 
 
}



 
function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}

function openMenu() {
if (document.getElementById('FirstDivMenu').style.display== "none") {	
    
	//HideAllLayers();
	document.getElementById('FirstDivMenu').style.display="block";
   // document.getElementById('listMenuCat').innerHTML="<table height=325 width=129 border=0 cellspacing=0 cellpadding=0 bgcolor=#FEFEFF class=borderMenu><tr><td style=height:100%><table style=height:100% align=center border=0 cellspacing=0 cellpadding=0><tr><Td style=height:100% align=center valign=middle><img src=images/Newloading_Pop.gif?11 border=0    ></td></tr></table></td></tr></table>";
	//contentObj=document.getElementById('listMenuCat');
	//getAjaxFile1('_TopMenu.asp?rnd='+Math.random());
	//switchImage("idPicSearch","images/searchFiSel.gif?00000")
	document.getElementById('listMenuCat').style.display="block";
}
else {
	//HideAllLayers();
	document.getElementById('FirstDivMenu').style.display="none";
	document.getElementById('listMenuCat').style.display="none";
}
}

function openMenuCooking() {
if (document.getElementById('FirstDivMenu').style.display== "none") {	
	HideAllLayers();
	document.getElementById('FirstDivMenu').style.display="block";
    document.getElementById('listMenuCat').innerHTML="<table height=325 width=129 border=0 cellspacing=0 cellpadding=0 bgcolor=#FEFEFF class=borderMenu><tr><td style=height:100%><table style=height:100% align=center border=0 cellspacing=0 cellpadding=0><tr><Td style=height:100% align=center valign=middle><img src=images/Newloading_Pop.gif?11 border=0    ></td></tr></table></td></tr></table>";
	contentObj=document.getElementById('listMenuCat');
	getAjaxFile1('_TopMenuCooking.asp?rnd='+Math.random());
	switchImage("idPicSearch","images/searchFiSel.gif?00000")
	document.getElementById('listMenuCat').style.display="block";
}
else {
	HideAllLayers();	
}
}
function HideAllLayers() {
	    //switchImage("idPicSearch","images/searchFi.jpg")
		//document.getElementById('listMenuCat').innerHTML='';
		document.getElementById('listMenuCat').style.display="none";
		document.getElementById('FirstDivMenu').style.display="none";
}

function changeMain(fromWein) {
	 
    document.getElementById('MainArticles').innerHTML="<table width=409 height=100% align=center border=0 cellspacing=0 cellpadding=0><tr><Td height=100% align=center valign=middle><img src=images/Newloading_Pop.gif?11 border=0    ></td></tr></table>";
	contentObj=document.getElementById('MainArticles');
	getAjaxFile2('ajaxArticles.asp?rnd='+Math.random()+'&fromWein='+fromWein);
 }
function ChangeColors() {
id=document.getElementById('colorPageAjax').value;
document.getElementById('underFlash').style.backgroundColor=id;	
}
 

function LatestModels(MainCatId,fromId) {
	  
    document.getElementById('AjaxLeftMenu'+fromId).innerHTML="<table height=100% align=center border=0 cellspacing=0 cellpadding=0><tr><Td height=100% align=center valign=middle><img src=images/Newloading_Pop.gif?11 border=0    ></td></tr></table>";
	contentObj=document.getElementById('AjaxLeftMenu'+fromId);
	getAjaxFile('latestModels.asp?MainCatId='+MainCatId+'&rnd='+Math.random());
	document.getElementById('AjaxLeftMenu'+fromId).style.display="block";
}

function LatestModels1(MainCatId) {
    document.getElementById('AjaxLeftMenu1').innerHTML="<table height=100% align=center border=0 cellspacing=0 cellpadding=0><tr><Td height=100% align=center valign=middle><img src=images/Newloading_Pop.gif?11 border=0    ></td></tr></table>";
	contentObj=document.getElementById('AjaxLeftMenu1');
	getAjaxFile('ajaxLatestNews.asp?MainCatId='+MainCatId+'&rnd='+Math.random());
	document.getElementById('AjaxLeftMenu').style.display="block";
}

function LatestCooks(MainCatId,fromId) {
    document.getElementById('AjaxLeftMenu'+fromId).innerHTML="<table height=100% align=center border=0 cellspacing=0 cellpadding=0><tr><Td height=100% align=center valign=middle><img src=images/Newloading_Pop.gif?11 border=0    ></td></tr></table>";
	contentObj=document.getElementById('AjaxLeftMenu'+fromId);
	getAjaxFile('ajaxLatestcooks.asp?MainCatId='+MainCatId+'&rnd='+Math.random());
	document.getElementById('AjaxLeftMenu'+fromId).style.display="block";
}


function LatestNews(MainCatId,fromId) {
	 document.getElementById('AjaxLeftMenu').innerHTML="<table height=100% align=center border=0 cellspacing=0 cellpadding=0><tr><Td height=100% align=center valign=middle><img src=images/Newloading_Pop.gif?11 border=0    ></td></tr></table>";
	contentObj=document.getElementById('AjaxLeftMenu');
	getAjaxFile('ajaxLatestNews.asp?MainCatId='+MainCatId+'&rnd='+Math.random());
	document.getElementById('AjaxLeftMenu').style.display="block";
}
function LatestNews1(MainCatId) {
    document.getElementById('AjaxLeftMenu1').innerHTML="<table height=100% align=center border=0 cellspacing=0 cellpadding=0><tr><Td height=100% align=center valign=middle><img src=images/Newloading_Pop.gif?11 border=0    ></td></tr></table>";
	contentObj=document.getElementById('AjaxLeftMenu1');
	getAjaxFile('ajaxLatestNews.asp?MainCatId='+MainCatId+'&rnd='+Math.random());
	document.getElementById('AjaxLeftMenu').style.display="block";
}

var popUpWin1=0;

function popUpWindow(URLStr, left, top, width, height)

{

  if(popUpWin1)

  {

    if(!popUpWin1.closed) popUpWin1.close();

  }

  popUpWin1 = open(URLStr, 'popUpWin1', '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 PrintArticle(articleId) {
	 popUpWindow("printArticle.asp?articleId="+articleId,30,30,730,700);
}

function OpenGallery(articleId) {
	 popUpWindow("demo.asp?articleId="+articleId,30,30,480,355)
}

var pp_gemius_identifier = new String('citKsQMTM_atxFg_6RRCS5Xk.oLF.m_ScPsVimDaulT.m7');
//ipsos code
// (c) 2000-2011 by Gemius SA

function gemius_parameters() {
	var d=document;
	var w=window;
	var href=new String(d.location.href);
	var ref;
	var f=0;
	var fv='-';
	var dd;
	if (d.referrer) { ref=new String(d.referrer); } else { ref=''; }
	if (typeof Error!='undefined') {
		var fo;
		eval('try { f=(d==top.document)?1:2; if (typeof top.document.referrer=="string") { ref=top.document.referrer } } catch(e) {f=3;}');
		eval('try { fv=navigator.plugins["Shockwave Flash"].description; } catch (e) {}');
		eval('if (typeof ActiveXObject!="undefined") { try { fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); } catch(e) { try { fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); fv="X"; fo.AllowScriptAccess="always"; } catch(e) { if (fv=="X") { fv="WIN 6,0,20,0"; }} try { fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); } catch(e) {} } if ((fv=="-" || fv=="X") && fo) { fv=fo.GetVariable("$version"); }}');
	}
	var url='&fr='+f+'&tz='+(new Date()).getTimezoneOffset();
	if (typeof encodeURIComponent != 'undefined') {
		url+='&fv='+encodeURIComponent(fv)+'&href='+encodeURIComponent(href.substring(0,499))+'&ref='+encodeURIComponent(ref.substring(0,499));
	}
	if (screen) {
		var s=screen;
		if (s.width) url+='&screen='+s.width+'x'+s.height;
		if (s.colorDepth) url+='&col='+s.colorDepth;
	}
	if (typeof w.innerWidth=='number') {
		url+='&window='+w.innerWidth+'x'+w.innerHeight;
	} else if ( ((dd = d.documentElement) && (dd.clientWidth || dd.clientHeight)) || ((dd = d.body) && (dd.clientWidth || dd.clientHeight)) ) {
		url+='&window='+dd.clientWidth+'x'+dd.clientHeight;
	}
	return url;
}

function gemius_add_onload_event(obj,fn) {
	if (obj.attachEvent) {
		obj.attachEvent('onload', fn);
	} else if(obj.addEventListener) {
		obj.addEventListener('load', fn, false);
	}
}

function gemius_append_script(xp_url) {
	if (typeof Error!='undefined') {
		eval('try { xp_javascript=document.createElement("script"); xp_javascript.src=xp_url; xp_javascript.type="text/javascript"; xp_javascript.defer=true; document.body.appendChild(xp_javascript); } catch(e) {}');
	}
}

function gemius_obj_loaded() {
	window.pp_gemius_loaded+=1;
	if (window.pp_gemius_loaded==2 && window.pp_gemius_image.width && window.pp_gemius_image.width>1) {
		gemius_append_script(window.pp_gemius_script);
	}
}

function pp_gemius_timer() {
	window.pp_gemius_timer_image = new Image();
	window.pp_gemius_timer_image.src = window.pp_gemius_host+(new Date()).getTime()+'/dot.gif?l=36'+window.pp_gemius_time_id+gemius_parameters();
}

function pp_gemius_array_to_string(arr,start) {
	var i,str;
	if (typeof arr == 'string') {
		return arr;
	}
	str = '';
	if (typeof arr.length != 'undefined') {
		for (i=start ; i<arr.length ; i++) {
			if (i>start) {
				str += '|';
			}
			str += ((new String(arr[i])).replace(/\|/g,'_'));
		}
	}
	return str;
}

var pp_gemius_proto = (document.location && document.location.protocol && document.location.protocol=='https:')?'https://':'http://';
if (typeof pp_gemius_hitcollector == 'undefined') {
	if (typeof gemius_hitcollector != 'undefined') {
		pp_gemius_hitcollector = gemius_hitcollector;
	} else {
		pp_gemius_hitcollector = 'galb.hit.gemius.pl';
	}
}
var pp_gemius_host = pp_gemius_proto+pp_gemius_hitcollector+'/_';
var pp_gemius_sv;
var pp_gemius_extrastr;

if (typeof pp_gemius_nhit == 'undefined') {
	if (typeof pp_gemius_identifier == 'undefined') {
		if (typeof gemius_identifier != 'undefined') {
			pp_gemius_identifier = gemius_identifier;
			gemius_identifier = 'USED_'+gemius_identifier;
		} else {
			pp_gemius_identifier = '';
		}
	}

	pp_gemius_extrastr = '';
	if (typeof encodeURIComponent != 'undefined') {
		if (typeof pp_gemius_extraparameters != 'undefined') {
			pp_gemius_extrastr = '&extra='+encodeURIComponent(pp_gemius_array_to_string(pp_gemius_extraparameters,0).substring(0,1999));
		} else if (typeof gemius_extraparameters != 'undefined') {
			pp_gemius_extrastr = '&extra='+encodeURIComponent(pp_gemius_array_to_string(gemius_extraparameters,0).substring(0,1999));
		}
	}

	if (typeof window.pp_gemius_cnt != 'undefined') {
		if (typeof window.pp_gemius_images == 'undefined') {
			window.pp_gemius_images = new Array();
		}
		var gemius_l = window.pp_gemius_images.length;
		window.pp_gemius_images[gemius_l]=new Image();
		window.pp_gemius_images[gemius_l].src = pp_gemius_host+(new Date()).getTime()+'/redot.gif?l=33&id=ERR_'+pp_gemius_identifier.replace(/id=/g,'id=ERR_')+gemius_parameters()+pp_gemius_extrastr;
	} else {
		if (typeof pp_gemius_time_identifier != 'undefined' && typeof window.pp_gemius_time_id == 'undefined') {
			window.pp_gemius_time_id = '&id='+pp_gemius_time_identifier;
			window.pp_gemius_host = pp_gemius_host;
			setInterval('pp_gemius_timer()',60*1000);
			pp_gemius_sv=35;
		} else {
			window.pp_gemius_time_id = '';
			pp_gemius_sv=31;
		}
		window.pp_gemius_image = new Image();
		if (typeof pp_gemius_mode == 'undefined') {
			window.pp_gemius_loaded = 0;
			window.pp_gemius_script = pp_gemius_host+(new Date()).getTime()+'/pp.js?id='+pp_gemius_identifier;
			gemius_add_onload_event(window,gemius_obj_loaded);
			gemius_add_onload_event(window.pp_gemius_image,gemius_obj_loaded);
			pp_gemius_sv-=1;
		}
		window.pp_gemius_image.src = pp_gemius_host+(new Date()).getTime()+'/rexdot.gif?l='+pp_gemius_sv.toString()+'&id='+pp_gemius_identifier+window.pp_gemius_time_id+gemius_parameters()+pp_gemius_extrastr;
		window.pp_gemius_cnt = 1;
	}
	if (typeof pp_gemius_events_identifier == 'undefined') {
		pp_gemius_events_identifier = pp_gemius_identifier;
	}
	pp_gemius_identifier = 'USED_'+pp_gemius_identifier;
}

function pp_gemius_hit_int(list,rfrom,rto) {
	var gu = pp_gemius_host+(new Date()).getTime()+'/redot.gif?l=32';
	if (typeof window.xgemius_prot_cnt == 'undefined') {
		window.xgemius_prot_cnt=0;
	}
	if (typeof xgemius_prot_cnt == 'undefined') {
		xgemius_prot_cnt=0;
	}
	if (window.xgemius_prot_cnt<=xgemius_prot_cnt) {
		go=1;
		window.xgemius_prot_cnt++;
	} else {
		go=0;
	}
	xgemius_prot_cnt++;
	if (rfrom==0 && rto==0) {
		gu += '&id='+list;
	} else {
		for (var i=rfrom ; i<rto ; i++) {
			gu += '&id='+list[i];
		}
	}
	gu += gemius_parameters();
	if (arguments.length>=4 && typeof encodeURIComponent != 'undefined') {
		gu += '&extra='+encodeURIComponent((new String(arguments[3])).substring(0,1999));
	}
	if (typeof window.gemius_hit_images == 'undefined') {
		window.gemius_hit_images = new Array();
	}
	var gl = window.gemius_hit_images.length;
	window.gemius_hit_images[gl]=new Image();
	if (go) {
		window.gemius_hit_images[gl].src = gu;
	} else {
		window.gemius_hit_images[gl].src = gu.replace(/id=/g,'id=DBL_');
	}
}

function pp_gemius_hit() {
	var i;
	for (i=0 ; i<arguments.length ; i+=5) {
		if (i+5<arguments.length) {
			pp_gemius_hit_int(arguments,i,i+5);
		} else {
			pp_gemius_hit_int(arguments,i,arguments.length);
		}
	}
}

function pp_gemius_event() {
	if (arguments.length>0) {
		if (arguments[0]) {
			pp_gemius_hit_int(arguments[0],0,0,pp_gemius_array_to_string(arguments,1));
		} else if (typeof pp_gemius_events_identifier != 'undefined') {
			pp_gemius_hit_int(pp_gemius_events_identifier,0,0,pp_gemius_array_to_string(arguments,1));
		}
	}
}

if (typeof gemius_hit != 'function') {
	gemius_hit = pp_gemius_hit;
}

if (typeof gemius_event != 'function') {
	gemius_event = pp_gemius_event;
}
