<!--store.js	http://www.greyblack.com

//
// Cookie Function
//

var vlnk = 'http://store.arabesquechicago.com/index.shtml?view';
var clnk = 'http://store.arabesquechicago.com/index.shtml?cout';
var blnk = 'http://store.arabesquechicago.com/cookies.html';
var flag = 'yes';
var expHours = 12;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expHours*60*60*1000));

function scc(){
var check = GetCookie('scc');
  if (check < 1148000000 || check > ogen) {
  assign();
  }
  else {
  SetCookie('scc', check, exp);
  }
}

function assign(){
SetCookie('scc', ogen, exp);
var verif = GetCookie('scc');
  if (verif != ogen) {
  document.location.href = blnk;
  }
}

function lcp(){
SetCookie('lcp', 'yes', exp);
var verif = GetCookie('lcp');
  if (verif != 'yes') {
  document.location.href = blnk;
  }
document.location.href = vlnk;
}

function shp(){
SetCookie('lcp', 'no', exp);
var verif = GetCookie('lcp');
  if (verif != 'no') {
  document.location.href = blnk;
  }
document.location.href = vlnk;
}

function clc(){
SetCookie('lcp', 'yes', exp);
var verif = GetCookie('lcp');
  if (verif != 'yes') {
  document.location.href = blnk;
  }
document.location.href = clnk;
}

function csh(){
SetCookie('lcp', 'no', exp);
var verif = GetCookie('lcp');
  if (verif != 'no') {
  document.location.href = blnk;
  }
document.location.href = clnk;
}

//
// Cookie Handling
//


function getCookieVal (offset) {  
var endstr = document.cookie.indexOf (";", offset);  
if (endstr == -1)    
endstr = document.cookie.length;  
return unescape(document.cookie.substring(offset, endstr));
}

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 styTog(targ_id,sty_attrJ,sty_attrC,set_val){
var targ=document.getElementById(targ_id);
var targ_stat="";
var targ_sty="";
var attr_chk=sty_attrC.toLowerCase()
var excp_flag=0;
if(attr_chk.indexOf("color")!=-1 || attr_chk.indexOf("font")!=-1){
excp_flag=1;
if(!document.getElementById("zedSpan")){
var insSpan=document.createElement("span");
insSpan.setAttribute("id","zedSpan");
document.body.appendChild(insSpan);
}
var zS=document.getElementById("zedSpan").style
zS[sty_attrJ]=set_val;
}
if(targ.currentStyle){ //code for IE
if(excp_flag==1)set_val=zS[sty_attrJ];
targ_stat=targ.currentStyle[sty_attrJ];
}else{ //code for W3C-spec-compatible
if(excp_flag==1){
var tst_span=document.getElementById("zedSpan");
var tst_sty=document.defaultView.getComputedStyle(tst_span,"");
set_val=tst_sty.getPropertyValue(sty_attrC);
excp_flag=0;
}
targ_sty=document.defaultView.getComputedStyle(targ,"");
targ_stat=targ_sty.getPropertyValue(sty_attrC);
}
targ_stat!=set_val ? targ.style[sty_attrJ]=set_val : targ.style[sty_attrJ]="";
}

//-->
