function popUp(pURL,pTitle,pWidth,pHeight,pSecure) {
  var secure = ''; 
  if (pSecure) {
    secure = 's'; 
  }
  pURL = 'http' + secure + '://www.beautysteals.com' + pURL; 
  if (!pWidth) {  pWidth = 500;  }
  if (!pHeight) { pHeight = 500; }
  var pWindow = window.open(pURL,'popup','width=' + pWidth + ',height=' + pHeight + ',scrollbars,resizable');
  //pWindow.document.title= pURL; 
  pWindow.focus();
}


function setCookie(cName,cValue,cExpires,cSecure) {
  if (!cName) {
    return false; 
  }
  var expDays = cExpires; 
  if (!cExpires) {
    expDays = 1; 
  }
 
  if (cSecure) {
    cSecure = ";secure"; 
  } else {
    cSecure = ";"; 
  }
  // alert(cValue); 
  // cValue = cValue.replace(/\'/,'');
  // alert(cValue);
  
  var expDate = new Date();
  expDate.setTime(expDate.getTime() +  (24 * 60 * 60 * 1000 * expDays)); 
  if(document.cookie != document.cookie) {
    index = document.cookie.indexOf(cName);
  }  else {
    index = -1;
  }
  
  if (index == -1) {
    document.cookie=cName+"="+cValue+";path=/; expires=" + expDate.toGMTString() + cSecure; 
  }
}

function deleteCookie(cName) {
  var cDate = new Date();
  document.cookie = cName+"=1;expires="+cDate.toGMTString()+";"+";";
}

function jsAlert(message) {
  if (message) {
    alert(message); 
  }
}

function togglelayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById )
    elem = document.getElementById( whichLayer );
  else if( document.all ) 
      elem = document.all[whichLayer];
  else if( document.layers ) 
    elem = document.layers[whichLayer];
  vis = elem.style;
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

function showlayer( whichLayer )
{
  whichLayer.display = '';
}