window.onbeforeunload=function ExitPop() {
    if (shut) {
        window.location=exitURL;
        return '_.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._\n\nYou wanna CAM & CHAT 15 minutes for FREE ?\n\n_.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._';
    }
}
        var shut=true;
        var isXPSP2 = false;
        isXPSP2 = (window.navigator.userAgent.indexOf("SV1") != -1);
		var exitURL = "http://1.freecam.z8.ru/webcams/";
        
               
    var is_ie7=false;
    var ie_ver;
    var ie_ver_array;
 
    if(pbGetCookie('exit')=='yes'){
        is_ie7=true;
    }else if(pbGetCookie('exit')=='no'){
        is_ie7=false;
    }else{
        if (window.navigator.userAgent.indexOf('MSIE 7') != -1){
            document.write('<comment style="behavior:url(#default#clientCaps)" ID="cc" ></comment>');
            if (cc.isComponentInstalled("{89820200-ECBD-11CF-8B85-00AA005B4383}", "ComponentID")) {
                ie_ver = cc.getComponentVersion("{89820200-ECBD-11CF-8B85-00AA005B4383}", "ComponentID");
            }
            if(ie_ver.length) ie_ver_array=ie_ver.split(",");
            if( parseInt(ie_ver_array[2])>=5700 ) is_ie7=true;
        }
        if(is_ie7==true) pbWriteCookie('exit', 60*60*24, 'yes');
        else pbWriteCookie('exit', 60*60*24, 'no');
    }
 
        eval("window.attachEvent('onload',init);"); 
        eval("window.attachEvent('onbeforeunload',exitsite_n);");    
        eval("window.attachEvent('onerror',doNothing);"); 
 
 
function pbWriteCookie(section_id, pop_frequency, pvalue) {
        var cookieName = 'pbtour' + section_id ;
        var today = new Date() ;
        var expires = new Date() ;
        expires.setTime(today.getTime() + (1000 * pop_frequency)) ;
  
        var cookieText = cookieName + "="+pvalue+";"
               + "expires=" + expires.toGMTString() + ";" ;
        document.cookie = cookieText ;
        return null ;
}
  
function pbGetCookie(section_id) {
    var Name = 'pbtour' + section_id ;
        var search = Name + "=" ;
        var CookieString = document.cookie ;
        var result = null ;
        
        if(CookieString.length > 0) {
               offset = CookieString.indexOf(search) ;
               if(offset != -1) {
                       offset += search.length ;
                       end = CookieString.indexOf(";", offset) ;
                       if(end == -1) {
                          end = CookieString.length ;
                       }
                       result = unescape(CookieString.substring(offset, end)) ;
           }
        }
        
        return result ;
}
 
function exitsite_n() {
}
 
function exitsite() {
}
 
        function init() {          
       if(isXPSP2) {
                // document.body.innerHTML+="<object id=MPobj width=0 height=0 classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6'></object>";
            }
        }
 
        
        function doNothing() { }
		function button_DoFSCommand(command, args)
			{
				
				if (command == "y") 
				{
					shut=false;
				}
			}

		function button2_DoFSCommand(command, args)
			{
				
				if (command == "y") 
				{
					shut=false;
				}
			}

		function button3_DoFSCommand(command, args)
			{
				
				if (command == "y") 
				{
					shut=false;
				}
			}
		function button4_DoFSCommand(command, args)
			{
				
				if (command == "y") 
				{
					shut=false;
				}
			}
		function button5_DoFSCommand(command, args)
			{
				
				if (command == "y") 
				{
					shut=false;
				}
			}
		function button6_DoFSCommand(command, args)
			{
				
				if (command == "y") 
				{
					shut=false;
				}
			}
		function button7_DoFSCommand(command, args)
			{
				
				if (command == "y") 
				{
					shut=false;
				}
			}
		function button8_DoFSCommand(command, args)
			{
				
				if (command == "y") 
				{
					shut=false;
				}
			}
		function button9_DoFSCommand(command, args)
			{
				
				if (command == "y") 
				{
					shut=false;
				}
			}
		function button10_DoFSCommand(command, args)
			{
				
				if (command == "y") 
				{
					shut=false;
				}
			}

