
/*
One Time Popup Script
By Website Abstraction (http://www.wsabstract.com) and
Java-Scripts.net (http://www.java-scripts.net)
Over 200+ free scripts here!
*/


//number of days the cookie should 
//last (0 will cause it to always pop up)
var expDays = 1; 

//url of the page you want to popup
var page = "http://lib1.store.vip.sc5.yahoo.com/lib/laptopoutlet/popup";

var windowprops = "width=340, height=135, location=no, toolbar=no, menubar=no, scrollbars=no, resizable=no";

function GetCookie (name) { 
  var arg = name + "="; 
  var alen = arg.length; 
  var clen = document.cookie.length; 
  var i = 0; 

  while (i < clen) { 
   var j = i + alen; 

   if (document.cookie.substring(i, j) == arg) 
       return getCookieVal (j); 

      i = document.cookie.indexOf(" ", i) + 1; 

 if (i == 0) break; 

} 

return null;

}

function SetCookie (name, value) { 
  var argv = SetCookie.arguments; 
  var argc = SetCookie.arguments.length; 
  var expires = (argc > 2) ? argv[2] : null; 
  var path = (argc > 3) ? argv[3] : null; 
  var domain = (argc > 4) ? argv[4] : null; 
  var secure = (argc > 5) ? argv[5] : false; 
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) + 
((domain == null) ? "" : ("; domain=" + domain)) + 
((secure == true) ? "; secure" : "");

}

function DeleteCookie (name) { 
  var exp = new Date(); 
  exp.setTime (exp.getTime() - 1); 
  var cval = GetCookie (name); 
  document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();

}

var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function amt(){
  var count = GetCookie('count')
   
  if(count == null) {
    SetCookie('count','1')
    return 1
} else {
   var newcount = parseInt(count) + 1;
   DeleteCookie('count')
   SetCookie('count',newcount,exp)
return count

}

}

function getCookieVal(offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1)
     endstr = document.cookie.length;
     return unescape(document.cookie.substring(offset, endstr));
}



function checkCount() {
  var count = GetCookie('count');
  if (count == null) {
    count=1;
    SetCookie('count', count, exp);
    window.open(page, "", windowprops);
  } else {
    count++;
    SetCookie('count', count, exp);
  }

}

// window.onload=checkCount



var moretxtvalue='';
var nRec = 0;
var related = new Array();
var CurrItemId='addcook';
var ie = false;
var ns6 = false;
var ns = false;
var opera = false;

function onFocusSearch(obj){
  if (obj.value=='Search') obj.value = '';
  obj.style.color = '#000000';
}

function onBlurSearch(obj,DefText){
  if (obj.value=='') {
    obj.value = DefText?DefText:'Search';
    obj.style.color = '#7f7f7f';
  } 
}

function checkSearch(obj,AlertMsg) {
  if (obj.value=='Search' || obj.value == '') {
    alert(AlertMsg?AlertMsg:'Enter search keywords!');
    return false;
  }
  return true;
}

if (eval(document.layers)) { ns=true; }
else {
    if (eval(document.all)) { ie=true; if (navigator.userAgent.indexOf('Opera')!=-1) opera=true;}
        else {
            if (eval(document.getElementById)) { ns6=true;}
            }
    }

// Hide and Show menu

//finds and return <DIV> object by given name


function Layer(layerName) {
return (ns)?(document.layers[layerName]):((ns6)?(document.getElementById(layerName)):(document.all(layerName)));
}
function enlarge(url,imgw,imgh) {
var leftPos = (screen.availWidth-900) / 2;
var topPos = (screen.availHeight-600) / 2;
imgw=eval(imgw)+20;
imgh=eval(imgh)+30;
window.open(url, 'EnlargePicture','width='+imgw+',height='+imgh+',scrollbars=no,resizable=no,statusbar=no,location=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}

function insertMore() {
if (moretxtvalue!='') {
    var leftPos = (screen.availWidth-900) / 2;
    var topPos = (screen.availHeight-600) / 2;
    var MoreInfo = new Object();
    MoreInfo = window.open('more_info.html', 'EnlargePicture','width=600,height=500,scrollbars=yes,resizable=no,statusbar=no,location=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
    MoreInfo.document.write('<html><head><title>The LapTop outlet - Product more info</title><link rel="stylesheet" href="http://p2.hostingprod.com/@laptopoutlet.com/main.css" type="text/css" title="main style sheet"><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"></head><body bgcolor="#064C9A" marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 rightmargin="0" link="#0E37A0" vlink="#0E37A0" alink="#0E37A0" background="http://p2.hostingprod.com/@laptopoutlet.com/images/bg-main.gif"><center><table border="0" cellpadding="0" cellspacing="0"><tr><td width="5" nowrap=""></td><td width="100%"><table cellpadding=0 cellspacing=0 border=0 background="" width="100%"><tr><td height="10"></td></tr><tr bgcolor="#064C9A"><td></td><td bgcolor="#ffffff"><table border="0" cellpadding="5" cellspacing="0"><tr><td class="smallfix3" height="400" valign="top">'+moretxtvalue+'</td></tr></table></td><td></td></tr><tr><td colspan="3" bgcolor="#064C9A"></td></tr><tr bgcolor="#064C9A"><td></td><td bgcolor="#ffffff"><div align="right"><font size=1 face="Arial" color="#cccccc">Design and System Improvements by <a href="http://www.ystoredesign.com" target="_blank"><font size=1 face="Arial" color="#cccccc">Y!StoreDesign Studio</font></a></font>&nbsp;&nbsp;</div></td><td></td></tr></table></td><td width="5" nowrap=""></td></tr></table></center></body></html>');
    }
else {
    alert('Your browser settings not allow to run scripts or version of your browser is old.');
    }
}

//var Currtop='<table cellpadding=0 cellspacing=0 border=0 width="603" background="img/t1a8.gif"><tr><td class="bignfix" align="center" height="24">CURRENTLY VIEWED ITEMS<br></td></tr></table><table cellpadding=0 cellspacing=0 border=0 width="603"><tr><td width="1" bgcolor="#C0C0C0"><img src="img/t-pixel.gif" width="1" height="1"><br></td><td width="601"><table cellpadding=0 cellspacing=0 border=0><tr>';
//var Currbot='</tr></table></td><td width="1" bgcolor="#C0C0C0"><img src="img/t-pixel.gif" width="1" height="1"><br></td></tr></table><img src="img/t3a5.gif" width="603" height="6" alt="" border="0"><br>';
//var Currdiv='<td width="1" bgcolor="#7E7D7D" nowrap=""><div style="padding:1px;"></div></td>';

//var CurrItema='<td class="boldthfix" valign="top" width="120" nowrap=""><center><table border="0" cellpadding="0" cellspacing="0"><tr><td height="60" width="68"><div style="padding:5px;"></div>';
//var CurrItemb='<br></div></td>';

var Currtop='<table border="0" cellpadding="0" cellspacing="0" class="pt3 pl3 pr3 w100"><tr><td><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="bt bl br"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="bHead" height="20"><b class="white">CURENTLY VIEWED ITEMS</b></td></tr><tr bgcolor="#ffffff"><td class="bl br" height="1"><img src="/pix.gif" alt="" width="1" height="1"/></td></tr><tr bgcolor="#2060C0"><td height="3"><img src="/pix.gif" alt="" width="1" height="1"/></td></tr><tr><td><table border="0" cellpadding="0" cellspacing="0" width="100%" class="lgray"  style="padding:0px;"><tr><td class="bl" width="1" nowrap=""><img src="/pix.gif" alt="" width="1" height="1"/></td>';
var Currbot='<td class="br"><img src="/pix.gif" alt="" width="1" height="1"/></td></tr></table></td></tr></table></td></tr></table></td></tr></table>';
var Currdiv='<td class="bl br" style="padding:0px;" nowrap width="1"><img src="/pix.gif" alt="" width="1" height="1"/></td>';

var CurrItema='<td align="center" valign="top" width="99" nowrap="" class="p3">';
var CurrItemb='</td>';

    function pasteRelated() {
    var asd=0;
    var Rell=false;
    for (var i=1;i<6;i++) {
        ccc='rel_'+i;
        if (GetCookie(ccc)) {
            Rell=true;
            asd=asd+1;
            }
        }
//  alert(GetCookie('rel_5'));
    if (Rell) {
        document.write(Currtop);
    for (var i=1;i<6;i++) {
        ccc='rel_'+i;
        if (GetCookie(ccc)) {
            tempvall=GetCookie(ccc);
            document.write(CurrItema);
            document.write(tempvall);
            document.write(CurrItemb);
            if (i!=5) {
                document.write(Currdiv);
                }
            }
        }
        document.write(Currbot);
        }
    }
    
function TellToFriend() {
var NewPop = new Object();
NewPop=window.open("custom/ytellafriend.php?link="+pid.toLowerCase(),"tellafriend","HEIGHT=280,WIDTH=520,scrollbars=yes,resizable=yes,top=50,left=50");
NewPop.window.focus();
}
function maillist(emailval) {
var NewPop = new Object();
NewPop=window.open('custom/addemail.php?mail='+emailval,'popupemail','HEIGHT=150,WIDTH=520,scrollbars=yes,resizable=yes,top=50,left=50');
NewPop.window.focus();
}
function PasteItem(num) {
var expdate = new Date (); 
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
cookievar='rotator'+num;
Items=eval('Items'+num);
if (!GetCookie(cookievar)) {
    SetCookie(cookievar, 1, expdate);
    }
if (!GetCookie(cookievar)) {
    cur=Math.round(Math.random()*(Items.length-1));
    }
    else {
    cur=eval(GetCookie(cookievar));
    }


if (Items[cur]) {
    document.write(Items[cur]);
    cur=cur+1;
    SetCookie(cookievar, cur, expdate);
    }
    else {
        if (Items[1]) {
        document.write(Items[1]);
        SetCookie(cookievar, 2, expdate);
        }
    }
}
function makeavailable(num,state) {
    obj=eval("document.forms.multiorder.vwitem"+num);
    obj.disabled=!state;
    obj=eval("document.forms.multiorder.vwquantity"+num);
    obj.disabled=!state;
    ((state)?(obj.value=1):(obj.value=0));
}
function chprice(pr,num) {
obj=eval("document.forms.multiorder.pricetxt"+num)
obj.value='$'+pr;
}
function calcoptions(num) {
var optval=0;
len=eval("optionvalue"+num+".length");
for (i=1;i<len;i++) {
optcheck=eval("optionvalue"+num+"[i]");
if (optcheck.indexOf('+$')!=-1) {
    optval=optval+eval(optcheck.split('(+$')[1].split(')')[0]);
    }
    else {
        if (optcheck.indexOf('-$')!=-1) {
            optval=optval+eval('-'+optcheck.split('(-$')[1].split(')')[0]);
            }
            else {
            optval=optval+0;
            }
    }
}
return eval(optval);
}
function updateall(num) {
/*
var totalprice;
calcq(num);
((eval("optionvalue"+num).length>0)?(totalprice=eval("qtyvalue"+num)*(eval("ipr"+num)+calcoptions(num))):(totalprice=eval("qtyvalue"+num)*eval("ipr"+num)));
chprice(totalprice,num);
*/
}
function calcq(num) {
obj=eval("ranges"+num);
for (var i=0;i<obj.length;i++) {
    q=eval("qtyvalue"+num);
    ((obj[i]['q']<=q)?(eval("ipr"+num+"=obj[i]['pr']")):(''))
    }
}

function PasteComments() {
document.write('<img src="img/t-pixel.gif" width="10" height="9"><br><table cellpadding=0 cellspacing=0 border=0 width="603" background="img/t5a4.gif"><tr><td class="boldthfix2" height="20"><div class="marg6">Customer Reviews</div><img src="img/t-pixel.gif" width="1" height="2"><br></td></tr></table><img src="img/t-pixel.gif" width="19" height="13" alt="" border="0"><br><table border="0" cellpadding="0" cellspacing="0" width="500"><tr><td width="500">')
for (var i=0; i<mesRecords.length;i++) {
    if (mesRecords[i].indexOf('|')!=-1) {
        tempval=mesRecords[i].split('|');
        document.write('<table cellpadding=0 cellspacing=0 border=0 width="100%"><tr><td valign="top" bgcolor="#B5B4B4"><table cellpadding=0 cellspacing=1 border=0 width="100%"><tr bgcolor="#ffffff"><td class="smallthfix4" width="173"><img src="img/t-pixel.gif" width="30%" height="3" alt="" border="0"><br><div class="marg3"><nobr><span class="hboldthfix"><b>'+tempval[1]+'</b></span> ('+tempval[0]+')<br></nobr></div><img src="img/t-pixel.gif" width="1" height="2" alt="" border="0"><br></td><td align="right" width="70%"><img src="custom/img/stars'+tempval[3]+'0.gif" width="55" height="13" alt="" border="0" hspace="7"><br></td></tr><tr bgcolor="#ffffff"><td class="smallfix" colspan="2"><img src="img/t-pixel.gif" width="1" height="3" alt="" border="0"><br><div class="marg0">'+tempval[2]+'</div><img src="img/t-pixel.gif" width="1" height="3" alt="" border="0"><br></td></tr></table></td></tr></table><img src="img/t-pixel.gif" width="1" height="16" alt="" border="0"><br>');
        }
    }
document.write('</td></tr></table>');
}
            function checkfileds(obj) {
            var msg='';
            ((obj.username.value=='')?(msg+='Pelease enter your name.\n'):(''));
            ((obj.vote.value==-1)?(msg+='Pelease select rating.\n'):(''));
            ((obj.message.value=='')?(msg+='Pelease enter message.\n'):(''));
            ((msg=='')?(obj.submit()):(alert(msg)))
            }
function addtorel() {
    related[CurrItemId]=CurrItem;
    for (var i=1;i<6;i++) {
    cc='rel_'+i;
    if (!GetCookie(cc)) {
        SetCookie(cc, related[CurrItemId]);
        break;
        }
    else {
            if (GetCookie(cc)==related[CurrItemId]) {
            break;
            }
            else {
            if (GetCookie('MaxItem')) {
                gg=true;
                for (var i=1;i<6;i++) {
                tt='rel_'+i;
                if (GetCookie(tt)==related[CurrItemId]) {
                    gg=false;
                    }
                }
                if (gg) {
                mm=GetCookie('MaxItem');
                kk='rel_'+mm;
                SetCookie(kk, related[CurrItemId]);
                if (eval(mm)!=5) {
                    mm=eval(mm)+1;
                    }
                    else {
                    mm=eval(mm);
                    mm=1;
                    }
                SetCookie('MaxItem', mm);
                break;
                }
                }
            }
        }
    if (i==5 && !GetCookie('MaxItem')) {
        SetCookie('MaxItem', 1);
        }
    }
}
function openImages() {
    var leftPos = (screen.availWidth-900) / 2;
    var topPos = (screen.availHeight-600) / 2;
    var MoreInfo = new Object();
    MoreInfo = window.open('images.html', 'EnlargePicture','width=600,height=500,scrollbars=yes,resizable=no,statusbar=no,location=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
//  MoreInfo.preloadimg(images);
}
function openVideos(num) {
    var leftPos = (screen.availWidth-900) / 2;
    var topPos = (screen.availHeight-600) / 2;
    var MoreInfo = new Object();
    MoreInfo = window.open('videos.html?video='+num, 'EnlargePicture','width=600,height=500,scrollbars=yes,resizable=no,statusbar=no,location=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
function openPoUp(url,w,h) {
    var leftPos = (screen.availWidth-900) / 2;
    var topPos = (screen.availHeight-600) / 2;
    var MoreInfo = new Object();
    MoreInfo = window.open(url, 'EnlargePicture','width='+w+',height='+h+',scrollbars=yes,resizable=no,statusbar=no,location=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
function openShipping(num) {
    var leftPos = (screen.availWidth-900) / 2;
    var topPos = (screen.availHeight-600) / 2;
    var MoreInfo = new Object();
    MoreInfo = window.open('shipping-calc.html', 'EnlargePicture','width=600,height=500,scrollbars=yes,resizable=no,statusbar=no,location=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}

function retriveimages(arrname) {
return eval(arrname);
}