var randnum;

var cssList = new Array(
         '01_ctk.css',
         '02_ctk.css',
         '03_ctk.css',
         '04_ctk.css');
		 

		 
function cambiaCSS(cami) {
   document.getElementById('cssCtk').setAttribute('href',cami+GetCSSAleatoria());
}
function SetACookie(name,value) {
	var theCookie = name + "=";
	theCookie = theCookie + escape(value);
	document.cookie = theCookie;
}
function GetCookieVal(offset) {
   var endstr = document.cookie.indexOf (";",offset);
   if (endstr == -1) { endstr = document.cookie.length; }
   return unescape(document.cookie.substring(offset,endstr));
}
function GetACookie(name) {
   var arg = name + "=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while(i < clen) {
      var j = i + alen;
      if (document.cookie.substring(i,j) == arg) {
         return GetCookieVal(j);
      }
      i = document.cookie.indexOf(" ", i) + 1;
      if(i == 0) break;
   }
   return null;
}
function GetCSSAleatoria() {
   cookieEnabled=(document.cookie.indexOf("ctk_css")!=-1)? true:false;
   if(cookieEnabled) {    
	return GetACookie('ctk_css');
   }
   else {      
      randnum = Math.floor(cssList.length * Math.random());
      SetACookie('ctk_css',cssList[randnum]);	  
      return cssList[randnum];
   }
}
function GetCabFlash() {
	(document.cookie.indexOf("ctk_cabFlash")!=-1)?
	  cookieEnabled=true:cookieEnabled=false;
   if(cookieEnabled) {
      return GetACookie('ctk_cabFlash');
   } 
   else {
	  return cabFlashList[randnum];  
   }	
}

function flashDest(nombreFlash) {
	var codigoFlash;
	codigoFlash='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="180" height="150">';
	codigoFlash=codigoFlash+'<param name=movie value="'+nombreFlash+'">';
	codigoFlash=codigoFlash+'<param name=quality value=high>';
	codigoFlash=codigoFlash+'<param name="wmode" value="transparent">';
	codigoFlash=codigoFlash+'<embed src="'+nombreFlash+'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="180" height="150" wmode="transparent">';
	codigoFlash=codigoFlash+'</embed>';
	codigoFlash=codigoFlash+'</object>';
	return codigoFlash;
}