// WebParter CM Script //
// 2009-03-18          //
// ya@cm-wp.com
/////////////////////////

function reload()  
{    
	document.location.reload(true);
	return true; 
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}

function setCookie(c_name,value)
{
var expiredays = 1;
var exdate=new Date();
exdate.setTime(exdate.getTime()+(5*60*1000));
//exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function c_cm(play,width,height)
{
played=getCookie('played');
if (played!=null && played!="")
  {

	document.write(" ");

  }
  else 
  {
	setCookie('played','1');
var css='<style type="text/css"> body{ height:100% } div.fullscreen{display:block; position:absolute; top:0; left:0; width:100%; height:100%; background:#ffffff; text-align:center; padding-top:7%; _padding-top:9%;} div.tvyta{ width:900px; height:632px; background:url("/cmflash/WPCMTV.jpg") no-repeat top #ffffff; padding:24px; _padding:24px; margin: 0 auto 0 auto;} </style>';
var flash='<div class="fullscreen"><div class="tvyta"><object type="application/x-shockwave-flash" data="/cmflash/flash/playflv.swf?vid='+play+'.flv" width="'+width+'" height="'+height+'"><param name="movie" value="/cmflash/flash/playflv.swf?vid='+play+'.flv" /></object></div></div>';

	document.write(css);
	document.write(flash);

  }
}

function flash_cm(flashplay,zwidth,zheight)
{
play=getCookie(zheight+'_'+zwidth);
if (play!=null && play!="")
  {

var playflash='<object type="application/x-shockwave-flash" data="'+flashplay+'.swf" width="'+zwidth+'" height="'+zheight+'"><param name="movie" value="'+flashplay+'.swf" /></object>';

	document.write(playflash);

  }
  else 
	{
	setCookie(zheight+'_'+zwidth,'1');
	document.write('<img src="cmflash/blank.gif" border="0" width="'+zwidth+'" height"'+zheight+'">');

  }
}


function flash_play(flashp,zwidth,zheight)
{
playg=getCookie(zheight+'_'+zwidth);
if (playg!=null && playg!="")
  {

var playfla='<object type="application/x-shockwave-flash" data="/cmflash/flash/playsflv.swf?vid='+flashp+'.flv" width="'+zwidth+'" height="'+zheight+'"><param name="movie" value="/cmflash/flash/playsflv.swf?vid='+flashp+'.flv" /></object>';

	document.write(playfla);

  }
  else 
	{
	setCookie(zheight+'_'+zwidth,'1');
	document.write('<img src="./../blank.gif" border="0" width="'+zwidth+'" height"'+zheight+'">');

  }
}