
// Image Ready Functions:///////////////////////////////////////////////////////////////////////////////////function MM_preloadImages() { //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_swapImgRestore() { //v3.0  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}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 MM_swapImage() { //v3.0  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}// Java Window Functions:///////////////////////////////////////////////////////////////////////////////////function popwin(winURL,winName,winWidth,winHeight,winLeft,winTop){
    window.open(winURL,winName,
    "height=" + winHeight +
    ",width=" + winWidth  +
    ",left="  + winLeft   +
    ",top="   + winTop    +
    ",menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0")
}function openNewWindow(URLtoOpen, windowName,windowFeatures) {    newWindow=window.open(URLtoOpen, windowName,windowFeatures);}function changeOpenerAndCloseMe(url) {
window.opener.window.location.href=url;
self.close()
}function goTo( url ) {
	window.location.href =  url;
}// Navigation Highlight Functions:///////////////////////////////////////////////////////////////////////////////////function navBar( tableCellRef, hoverFlag, navStyle ) {
	if ( hoverFlag ) {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#669900';
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#c00';
				}
		}
	} else {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#285028';
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#000';
				}
		}
	}
}

function navBarClick( tableCellRef, navStyle, url ) {
	navBar( tableCellRef, 0, navStyle );
	goTo( url );
}
// Search and Store Dropdown functions:///////////////////////////////////////////////////////////////////////////////////
function goTo( url ) {
	window.location.href =  url;
}

function Search() { 
if (document.forms[0].QUERY.value=='') return;
document.forms[0].action='/Search.aspx'; 
document.forms[0].submit();
} function SwitchStore() { 
    switch (document.forms[0].STORE_ID.value) {
    case '10':
        goTo('http://www.gnld.jp');
        return;
    case '1': 
        //US
         goTo('http://www.gnld.com/?STORE_ID=1');
        return;
    case '2': 
        //US Spanish
         goTo('http://www.gnld.com/?STORE_ID=2');
        return;
    case '3': 
        //Mexico
         goTo('http://www.gnld.com/?STORE_ID=3');
        return;
    case '4': 
        // Sweden
         goTo('http://www.gnld.com/?STORE_ID=4');
        return;
    case '5': 
        //Italia
         goTo('http://www.gnld.com/?STORE_ID=5');
        return;      
    case '7': 
        //Africa
         goTo('http://www.gnld.com/?STORE_ID=7');
        return;
    case '8': 
        // Australia
         goTo('http://www.gnld.com/?STORE_ID=8');
        return;
    case '9': 
        //New Zealand
         goTo('http://www.gnld.com/?STORE_ID=9');
        return;
    case '11': 
        // UK
         goTo('http://www.gnld.com/?STORE_ID=11');
        return;        
    case '12': 
        // Finland
         goTo('http://www.gnld.com/?STORE_ID=12');
        return;        
    case '13': 
        // Estonia
         goTo('http://www.gnld.com/?STORE_ID=13');
        return;  
    case '14': 
        // Bosnia
         goTo('http://www.gnld.com/?STORE_ID=14');
        return;  
     case '15': 
        // Croatia
         goTo('http://www.gnld.com/?STORE_ID=15');
        return;  
    case '16': 
        // Slovenia
         goTo('http://www.gnld.com/?STORE_ID=16');
        return;        
    case '17': 
        //Hungary
         goTo('http://www.gnld.com/?STORE_ID=17');
        return;    
    case '18': 
        //Philippines
         goTo('http://www.gnld.com/?STORE_ID=18');
        return;     
    case '19': 
        // Canada
         goTo('http://www.gnld.com/?STORE_ID=19');
        return;
    case '20': 
        // Germany
         goTo('http://www.gnld.com/?STORE_ID=20');
        return;
    case '21': 
        // Romania
         goTo('http://www.gnld.com/?STORE_ID=21');
        return;
    case '22': 
        // Carrib
         goTo('http://www.gnld.com/?STORE_ID=22');
        return;
    case '25': 
        // Serbia
         goTo('http://www.gnld.com/?STORE_ID=25');
        return;
    default:
       if (queryString('STORE_ID') != document.forms[0].STORE_ID.value ) {
         goTo('http://ww1.gnld.com/?STORE_ID=' + document.forms[0].STORE_ID.value);
	}
       //document.forms[0].submit();
        return;
      }
}// COOKIE FUNCTIONS
function getCookie(c_name)
{
    if (document.cookie.length>0) {
    c_start=document.cookie.indexOf(c_name + "=")
       if (c_start!=-1) { 
            c_start=c_start + c_name.length+1 ;
            c_end=document.cookie.indexOf(";",c_start);
            if (c_end==-1) c_end=document.cookie.length;
             return unescape(document.cookie.substring(c_start,c_end))
          } 
      }
    return null;
}


function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setTime(exdate.getTime()+(expiredays*24*3600*1000));
document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate);
}


function checkCookie(c_name)
{
  c_name_value=getCookie(c_name)
  alert(c_name + '= '+ c_name_value );
}


// QUERYSTRING FUNCTIONS
function PageQuery(q) {
    if(q.length > 1) this.q = q.substring(1, q.length);
    else this.q = null;
    
    this.keyValuePairs = new Array();
    if(q) {
        for(var i=0; i < this.q.split("&").length; i++) {
            this.keyValuePairs[i] = this.q.split("&")[i];
        }
    }
    
    this.getKeyValuePairs = function() 
        { return this.keyValuePairs; }
    
    this.getValue = function(s) {
        for(var j=0; j < this.keyValuePairs.length; j++) {
            if(this.keyValuePairs[j].split("=")[0] == s)
                return this.keyValuePairs[j].split("=")[1];
        }
        return null;
    }

    this.getParameters = function() {
        var a = new Array(this.getLength());
        for(var j=0; j < this.keyValuePairs.length; j++) {
            a[j] = this.keyValuePairs[j].split("=")[0];
        }
        return a;
    }

    this.getLength = function() 
    { return this.keyValuePairs.length; } 
}

function queryString(key){
var page = new PageQuery(window.location.search); 
if (page.getValue(key) == null) { return null; }
else { return unescape(page.getValue(key)); }

}

                       
if (queryString('STORE_ID')== '1' || queryString('STORE_ID')== '2' || queryString('STORE_ID')== '3'|| queryString('STORE_ID')== '4'|| queryString('STORE_ID')== '5' || queryString('STORE_ID') == '7' || queryString('STORE_ID') == '8' || queryString('STORE_ID') == '9' || queryString('STORE_ID') == '11' || queryString('STORE_ID') == '12' || queryString('STORE_ID') == '13' || queryString('STORE_ID') == '14' || queryString('STORE_ID') == '15' || queryString('STORE_ID') == '16' || queryString('STORE_ID') == '17' || queryString('STORE_ID') == '18' || queryString('STORE_ID') == '19' || queryString('STORE_ID') == '20' ||queryString('STORE_ID') == '21' || queryString('STORE_ID') == '22' || queryString('STORE_ID') == '25') {
        goTo('http://www.gnld.com/?STORE_ID=' + queryString('STORE_ID') + '&T2=3');
  }
