Array.prototype.remove=function(s){
  for(i=0;i<this .length;i++){
    if(s==this[i]) this.splice(i, 1);
  }
}
function createCookie(name,value,days) 
  {
  if (days){
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
           }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
  }
function readCookie(name) 
  {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
                                 }
  return null;
  }
function removeCookie(name) {
	createCookie(name,"",-1);
}
 	
 	
function checkLB(){        			
				      var lbd = readCookie('lbdisplayed');
				      if(!lbd){
                removeCookie('lblocked');
                if (!window.XMLHttpRequest) {jQuery("#po").colorbox({width:"750px", height:"660px", iframe:true,open: true,opacity:0.3});} else{
                jQuery("#po").colorbox({width:"720px", height:"630px", iframe:true,open: true,opacity:0.3});}
              }
              if(lbd==1){
                removeCookie('lblocked');
                          if (!window.XMLHttpRequest) {jQuery("#po").colorbox({width:"750px", height:"660px", iframe:true,open: true,opacity:0.3});} else{
                jQuery("#po").colorbox({width:"720px", height:"630px", iframe:true,open: true,opacity:0.3});}
              }
                if(lbd==2){
                removeCookie('lblocked');
                          if (!window.XMLHttpRequest) {jQuery("#po").colorbox({width:"750px", height:"660px", iframe:true,open: true,opacity:0.3});} else{
                jQuery("#po").colorbox({width:"720px", height:"630px", iframe:true,open: true,opacity:0.3});}
              }
              if(lbd==3){
                  disableLB();
              }         
}
function checkLB2(){
  var lbd = readCookie('lbdisplayed');
  if(!lbd){createCookie('lbdisplayed','1','0.02');}
  if(lbd==1){createCookie('lbdisplayed','2','0.02')}
  if(lbd==2){disableLB();}
  }
function disableLB(){
  createCookie('lbdisplayed','3','365');createCookie('lblocked',true,'365');
  //parent.jQuery.fn.colorbox.close();
  }
 
 //jQuery("#cboxClose2").colorbox.close()
