var wHeight, wWidth, sHeight, sWidth, bitDepth;

sHeight = screen.height;
sWidth = screen.width;
		

function setCookie (name, value) {
  // Enter number of days the cookie should persist
  var expDays = 30;
  var exp = new Date(); 
  exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
  expirationDate = exp.toGMTString();
  // Set cookie with name and value provided
  // in function call and date from above
  document.cookie = name + "=" + escape(value)
  document.cookie += "; expires=" + expirationDate;
}


function getCookie(c_name){
   value = "";
	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;
				}			
				value = unescape(document.cookie.substring(c_start,c_end))
			}else{
				value = ""
			}
	  }else{
		value=""
	}
	return value;
}
function checkCookie(){

	var c_width=getCookie('VagaBondSetSite')
	var c_height=getCookie('Check_VagaBondSetSite_Height')
	
	if (c_height==null || c_height=="" || c_height=="undified"){
		setCookie('Check_VagaBondSetSite_Height',sHeight)
		c_height=getCookie('Check_VagaBondSetSite_Height')
	}
	if(c_height!=sHeight){
		setCookie('Check_VagaBondSetSite_Height',sHeight)
		c_height=getCookie('Check_VagaBondSetSite_Height')
	}
	
	if (c_width!=null && c_width!="" && c_width!="undified"){
	/*alert("c_width:"+c_width)
	alert("parseInt(c_width):"+parseInt(c_width))
	alert("parseInt(sWidth):"+parseInt(sWidth))*/
		if(parseInt(c_width)!= parseInt(sWidth)){
			setCookie('VagaBondSetSite',sWidth)
			window.moveTo(0,0)
			window.resizeTo(sWidth,sHeight)

			//alert("c_width:"+c_width+"__sWidth:"+sWidth+"_c_height:"+c_height+"....sHeight:"+sHeight)
		}		
	}else{	
		setCookie('VagaBondSetSite',sWidth)
		c_width=getCookie('VagaBondSetSite')		
	}
	
}


 function OpenFlash(path) {  
	 if (document.all) {
		top.window.resizeTo(screen.availWidth,screen.availHeight);     
		h = screen.availHeight + 25;  
	}else if (document.layers||document.getElementById) {
	   if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
		  	top.window.outerHeight = screen.availHeight;
			top.window.outerWidth = screen.availWidth;
	  	}		  
		h = screen.availHeight - 45;  
    }		 
    window.open(path+'?w='+screen.availWidth+'&h='+h+'','xxx','width='+screen.availWidth+',height='+screen.availHeight+',fullscreen=1,scrollbar=no,directories=no,minimize=no')
  }

