function displayWindowSS(url, width, height) {
        if (navigator.appName == 'Netscape'){
                height = parseInt(height) + 16;
        }
        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=no' );
        if (!Win.opener) Win.opener=top.frames[0];
        if (Win.focus) Win.focus();
}

function displayWindowglobal(url, width, height) {
var Win2 = window.open(url,"displaywindowglobal",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no,status=no' );
Win2.focus();
}

var agt=navigator.userAgent
var yourOS="PC"
if (agt.indexOf("Mac")!=-1)
   {yourOS='Mac'}
var yourBrowse="IE"
if (navigator.appName == 'Netscape')
   {yourBrowse="NS"}
if (navigator.appVersion.substr(22,1) >= "5")
{ver5="Yes"}

if((yourOS=="Mac" && yourBrowse=="NS")||(yourOS=="Mac" && yourBrowse=="IE" && ver5 != "Yes")){
        document.write('<LINK rel="stylesheet" href="/css/mainMAC.css" type="text/css">')
}
else{
        document.write('<LINK rel="stylesheet" href="/css/main.css" type="text/css">')
}

function toplightboxrefresh() {
	if (parent == top){
		parent.frames[1].location = "/bin/Cklb?ref=/bin/Search?n~1^fmt~table&mr=25&max_res=25";
	} else {
		 parent.location = "/bin/Cklb?ref=/bin/Search?n~1^fmt~table&mr=25&max_res=25";
	}
}

function topcartrefresh() {
	if (parent == top){
		parent.frames[1].location = "/bin/Cklb?ref=/bin/Cart?op~view";
	} else {
		 parent.location = "/bin/Cklb?ref=/bin/Cart?op~view";
	}
}

var ggsession = ggetCookie("gmpsess");
var ggusert = ggetCookie("usert");

function topsearchrefresh() {
        if (ggsession && ggusert) {
                if (parent.frames[1].frames[1]){
                        if (parent.frames[1].frames[3]){
                        parent.frames[1].frames[1].location= "/user/search.shtml";
                        } else {
                        parent.frames[1].frames[0].location= "/user/search.shtml";
                        }
                } else {
                        parent.frames[1].location = "/bin/Cklb?ref=/user/search.shtml";
                }
        } else {
                        parent.frames[1].location= "/user/search.shtml";
        }
}

function topsearchrefreshpower() {
	if (parent == top){
		parent.frames[1].location = "/bin/Cklb?ref=/user/search_advanced.shtml";
	} else { 
		parent.location = "/bin/Cklb?ref=/user/search_advanced.shtml";
	}
}

function topsearchconcept() {
	if (parent == top){
		parent.frames[1].location = "/bin/Cklb?ref=/search_concept.shtml";
	} else { 
		parent.location = "/bin/Cklb?ref=/search_concept.shtml";
	}
}

function tload(dref)
{
	if(parent.thetop.href != dref){
		parent.thetop.location=dref;
	}
}

function siderefresh()
{
parent.left.location.replace('/bin/Search?n=1&mr=25&max_res=25');

}

function csiderefresh(id){
	

	xcurrentdate = new Date();
	xcore = xcurrentdate.getSeconds();
	if (id){
		parent.left.location.replace('/bin/Cart?op=view&lc='+ id + '&random=' + xcore );
	} else {
		parent.left.location.replace('/bin/Cart?op=view' + '&random=' + xcore);
	}
}

function lccsiderefresh(id)
{
parent.left.location.replace('/bin/Cart?op=view&lc=1');
}


function VersionNavigateur(Netscape, Explorer) {
  if ((navigator.appVersion.substring(0,3) >= Netscape && navigator.appName == 'Netscape') ||      
      (navigator.appVersion.substring(0,3) >= Explorer && navigator.appName.substring(0,9) == 'Microsoft'))
    return true;
else return false;
}
function netie(net, ie) {
  if ((navigator.appVersion.substring(0,3) >= net && navigator.appName == 'Netscape' && net != -1) || (navigator.appVersion.substring(0,3) >= ie && navigator.appName.substring(0,9) == 'Microsoft' && ie != -1))
    return true;
else return false;
}

function cceditWindow()
{
  ccedit_window =
    window.open("https://argus.auroraquanta.com/bin/Profile?cc=1","ccedit","width=500,height=320,status=1");
}





// all new functions
function addlb(id) {
		if (parent.lb) {
			 var theurl= '/bin/ExLbAdd?id=' + id;
			//var theurl= '/bin/Add_to_lightbox?id=' + id + '&add=1&ii=1';
			parent.lb.location=theurl;
		} else {
			var theurl= '/bin/Cklb?atlb=' + id;
			self.location=theurl;
		}
}
function addcart2(id) {
		if (parent.lb) {	
			parent.lb.location = '/bin/Cart?op=add&id=' + id + '&fmt=index';
			parent.com.location = '/user/cart_menu.shtml';

		} else {
			var theurl= '/bin/Cklb?atct=' + id;
			self.location=theurl;
		}
}



function gsetCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function ggetCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds

function gdeleteCookie(name, path, domain) {
  if (ggetCookie(name)) {
    document.cookie = name + "=" + 
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"
function gfixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

function gGetQV(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("="); 
    if (pair[0] == variable) {    
      return pair[1];         
    }                
  }  
  return false;
}
 
function checkRef() {
 var portal = getQV('portal');
 if (portal){
 var portalcookie = getCookie('portal');
  if (portalcookie != portal){
    setCookie('portal',portal,'','/');
  }
 } 
}



function gsetCookie2(name2,value2) {
	gsetCookie(name2, value2, '', '/', gGetCookieDom());
}

function gGetCookieDom(){
var thisdomain = document.domain;
var domainparts = thisdomain.split(".");
var end = domainparts.length - 1;
var start = domainparts.length - 2;
var domainend = domainparts[end];
var domainstart = domainparts[start];
var setdom = "." + domainstart + "." + domainend;
return setdom;
}

function gSetBackpage() {   
var thispage = location.href;
gsetCookie('backpage', thispage, '', '/', gGetCookieDom());
}

function golastsearchpage() {
        var backpage= ggetCookie('backpage');
        if (backpage){
                self.location = backpage;
        }
}




function updatesmall(){
	var gchoices='';

	if(document.isn.searchinclude[0].checked){
		gchoices = 'rm,';
	} 

	if(document.isn.searchinclude[1].checked){
		gchoices += 'rf,';
	}
	
	gsetCookie2('choices',gchoices);
}




function updatechoices(){
	var gchoices='';

	if(document.isn.searchinclude[0].checked){
		gchoices += 'rm,';
	}
	if(document.isn.searchinclude[1].checked){
		gchoices += 'rf,';
	}
	if(document.isn.color[0].checked){
		gchoices += 'any,';
	}
	if(document.isn.color[1].checked){
		gchoices += 'color,';
	}
	if(document.isn.color[2].checked){
		gchoices += 'gray,';
	}
	
	
	if(document.isn.orient[0].checked){
		gchoices += 'horizontal,';
	}
	if(document.isn.orient[1].checked){
		gchoices += 'vertical,';
	}
	if(document.isn.orient[2].checked){
		gchoices += 'panoramic,';
	}
	if(document.isn.orient[3].checked){
		gchoices += 'square,';
	}
	
	
	gsetCookie2('choices',gchoices);
}

function gMM_swapImgRestore() { //v3.0
  var i,x,a=document.gMM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function gMM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=gMM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function gMM_swapImage() { //v3.0
  var i,j=0,x,a=gMM_swapImage.arguments; document.gMM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=gMM_findObj(a[i]))!=null){document.gMM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function relatedkeywords (qq){
        self.location.href='/bin/Search2?frmloc=detailjs&Keywords=' + qq;
}


function relatedkeywords (qq){
        self.location.href='/bin/Search2?frmloc=detailjs&Keywords=' + qq;
}

