
function changePosition(val){

  if(val==1) document.getElementById("bartab").style.backgroundPosition="15px 0";
  if(val==2)  document.getElementById("bartab").style.backgroundPosition="130px 0";
  if(val==3)  document.getElementById("bartab").style.backgroundPosition="255px 0";
  if(val==4)  document.getElementById("bartab").style.backgroundPosition="368px 0";

  for(hh=1;hh<=4;hh++){
		 if(hh!=val){
			document.getElementById("listnew"+hh).style.display='none';
		 }else{
			document.getElementById("listnew"+hh).style.display='';
		 }
	}

}

function changeFwdder(val){

  if(val==1) document.getElementById("bartab_f").style.backgroundPosition="27px 0";
  if(val==2)  document.getElementById("bartab_f").style.backgroundPosition="118px 0";
  if(val==3)  document.getElementById("bartab_f").style.backgroundPosition="200px 0";
  if(val==4)  document.getElementById("bartab_f").style.backgroundPosition="288px 0";

   window.fwd.location.replace("http://www.yenta4.com/fwdder.php?id="+val);

}


function changeMobile(val){

  window.mobile.location.replace("http://www.yenta4.com/ringtone/loadringtone.php?id="+val);

	var divv = document.getElementById('mmo');
	var cls = divv.getElementsByTagName('div');
			for (i=0;i<cls.length;i++){
					var j=parseInt(i)+1;
					if(j==val){
						cls[i].className="menu_m"+j+"_over";
					}else{
						cls[i].className="menu_m"+j;
					}
				

			}

}



function chGame(){
var ch=0;
  if(document.getElementById("tabgame").src=="http://www.yenta4.com/images_index2007/hHome2007_D_06_B.gif" && ch==0){
	  document.getElementById("tabgame").src="http://www.yenta4.com/images_index2007/hHome2007_D_06_A.gif";
	  var rval=2;
	  var val=1;
	  ch=1;
  }
  if(document.getElementById("tabgame").src=="http://www.yenta4.com/images_index2007/hHome2007_D_06_A.gif" && ch==0){
	  document.getElementById("tabgame").src="http://www.yenta4.com/images_index2007/hHome2007_D_06_B.gif";
	   var rval=1;
	   var val=2;
	   ch=1;
  }
			document.getElementById("gamex"+val).style.display='none';
			document.getElementById("gamex"+rval).style.display='';
}


function chMovie(){
var ch=0;
  if(document.getElementById("tabmovie").src=="http://www.yenta4.com/images_index2007/Movie_b.jpg" && ch==0){
	  document.getElementById("tabmovie").src="http://www.yenta4.com/images_index2007/Movie_a.jpg";
	  var rval=2;
	  var val=1;
	  ch=1;
  }
  if(document.getElementById("tabmovie").src=="http://www.yenta4.com/images_index2007/Movie_a.jpg" && ch==0){
	  document.getElementById("tabmovie").src="http://www.yenta4.com/images_index2007/Movie_b.jpg";
	   var rval=1;
	   var val=2;
	   ch=1;
  }
			document.getElementById("moviex"+rval).style.display='none';
			document.getElementById("moviex"+val).style.display='';
}



////////////////////////////////////
/*  javascript ads right  nextback */
//////////////////////////////////////

function checkBrowser(){
		
	   if(navigator.appName == "Microsoft Internet Explorer") return true;
	   else  return false;

 }


var ads=4; //4 ads
var adsloop;
nowAds=randAds(ads); //now ads


function nowrightAds(){
  chAds(nowAds);
}

if(document.getElementById("frm_ads_r")){
	  replaceAds(nowAds);
}

function hiddenLoad(){
	//  document.getElementById("loading_ads").style.display='none';
}

function showLoad(){
	//  document.getElementById("loading_ads").style.display='';
}

function replaceAds(nowAds){
	   /*obj=document.getElementById("AIS_hotspot");

	  window.AIS_hotspot.location.replace("http://www.yenta4.com/recbanner.html");
	   
	   obj.style.display="none";
	   if(checkBrowser()){
		   obj.filters[0].Apply();    
		   obj.filters[0].Play(); 
	  }
	   obj.style.display="";
	   
*/
	 
}

function randAds(index){ 

			today=new Date();
			jran=today.getTime();
			var MaxNumber = index;
			ia=9301;
			ic=49297;
			im=233280;
			jran = (jran*ia+ic) % im;
			rand = Math.ceil( (jran/(im*1.0)) *MaxNumber);  
			return rand;

} 

function chAds(value){
	   for(c=1;c<=ads;c++){
			if(c==value){
				   showLoad();
				   var divv = document.getElementById('ads'+c);
					var cls = divv.getElementsByTagName('div');
					for (i=0;i<cls.length;i++){
						if(cls[i].className.indexOf('ads_page') != -1) cls[i].className="ads_page_s";
						replaceAds(c);
					}
			}else{
					var divv = document.getElementById('ads'+c);
					var cls = divv.getElementsByTagName('div');
					for (i=0;i<cls.length;i++){
						if(cls[i].className.indexOf('ads_page_s') != -1) cls[i].className="ads_page";
					}
			}

		}//for
}

 function nextAds(){
		   nowAds=nowAds+parseInt(1);
		   if(nowAds>ads)nowAds=1; 
			chAds(nowAds);
			
 }

 function backAds(){
		   nowAds=nowAds-parseInt(1);
		   if(nowAds<1)nowAds=ads; 
		   chAds(nowAds);

 }

function stopAds(){
		//	clearInterval(adsloop);
 }
 function startAds(){
		//	adsloop=setInterval("nextAds()",10000);
 }


