function fnull(){

}
function checkout (){
	top.location.href='/bin/Cart?op=ckout';
}

var now = new Date();
gfixDate(now);
now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000); 

function MM_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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function toplightboxrefresh() {
	if (ggsession && ggusert) {
		// logged in
             	if (parent.content.left){
             		parent.content.left.location= "/user/search.shtml";
            	} else {
                        	parent.content.location= "/user/search.shtml";
            	}
	} else 	if(frames['content']){
                       	parent.content.location= "/user/search.shtml";
	} else {
		document.location.href="/user/search.shtml";
	}


	if (frames['content']){
		frames['content'].location = "/bin/Cklb?ref=/bin/Search?n~1^fmt~list";
	} else {
		 parent.location = "/bin/Cklb?ref=/bin/Search?n~1^fmt~list";
	}
}

function topcartrefresh() {

	if (ggsession && ggusert) {
		// logged in
             	if (parent.content.left){
             		parent.content.left.location= "/bin/Cart?op~view";
            	} else {
                        	top.location= "/bin/Cklb?ref=/bin/Cart?op~view";
            	}
	} else 	if(frames['content']){
                       	parent.content.location= "/bin/Cart?op~view";
	} else {
		document.location.href="/bin/Cklb?ref=/bin/Cart?op~view";
	}


	if (frames['content']){
		frames['content'].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 openIFrame(IFrameID, URL){
	var tobj = MM_findObj("player");
	tobj.location.href=URL;
}

function playsong(psid,psartist,psalbum,pssong,psplaymode,psimage,poll_id) {
	var psurl = 'http://www.musiclicensingstore.com/musicplayer.shtml?artist=' + psartist;
	if(poll_id){psurl += '&poll_id=' + poll_id;}
	psurl += '&id=' + psid + '&albumname=' + psalbum + '&song=' + pssong + '&playmode=' + psplaymode + '&im=' + psimage;

	var newwin = window.open(psurl,"musicplayer",'width=540,height=135,resizable=0,scrollbars=no,menubar=no,status=no' );
	if (!newwin.opener) newwin.opener=parent;
	if (newwin.focus) newwin.focus();
	
}

function sendFeedBack(){
	document.feedback.submit();
	return;
}

function topsearchrefresh() {
	if (ggsession && ggusert) {
	// logged in
                if (parent.content.left){
                        parent.content.left.location= "/user/search.shtml";
                } else {
                        parent.content.location= "/user/search.shtml";
                }
	} else 	if(frames['content']){
                       	parent.content.location= "/user/search.shtml";
	} else {
		document.location.href="/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&fmt=list');

}

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://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&fmt=index&id=' + id;
			parent.com.location = '/user/cart_menu.shtml';

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


function gsetCookie(name, value, expiredays, path, domain, secure) {
  var ExpireDate = new Date ();
  ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
  var curCookie = name + "=" + escape(value) +
      ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

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


// 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 gGetCookieDom(){
}

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



function gsetuser() {

return;

/*
	var gwhichuserset = ggetCookie("gwhichuser");
	if(typeof gwhichuser != 'undefined' && gwhichuser) {
		gsetCookie("gwhichuser","",now);
	} else {
		gsetCookie("gwhichuser",document.l.username.value,now);
	}

  */
}






































