

//JK Popup Window Script (version 3.0)- By JavaScript Kit (http://www.javascriptkit.com)
//Visit JavaScriptKit.com for free JavaScripts
//This notice must stay intact for legal use
//Win Type: Pop Up | Session Only
    
//Specify URLs to randomly select from and popup/popunder:
//To display a single URL, just remove all but the first entry below:
var popurls=new Array()
//popurls[0]="http://www.kzshare.com";
popurls[0]="";


function openpopup(popurl){
if(popurl != null){
var winpops=window.open(popurl,"javzone","width=800,height=640,toolbar,location,status,scrollbars,menubar,resizable");
}
}

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1)
         end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

function loadornot(){

var cookiename = 'popup';
if (get_cookie(cookiename)==''){

openpopup(popurls[Math.floor(Math.random()*(popurls.length))]);
document.cookie=cookiename+"=yes";
//alert(get_cookie(cookiename));
}else{
//alert(get_cookie(cookiename));

}
}
if(popurls[0] != ''){
document.onclick = loadornot;
}
