function popup(url,width,height,name) {
    if (width == '' || width == null) width = 400;
    if (height == ''|| height == null) height = 425;
    if (name == '' || name == null) name = "details";
    var props = "toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,titlebar=no,menubar=no,width="+width+",height="+height;
    w = window.open(url, name, props);
    if (w) w.focus();
}

//order confirmation and order receipt page - split the email address on the RHN if too long
function splitEmailAdd(usemail) {
	var stringlist = new Array();
	while (usemail.length > 35) {
	   stringlist.push( usemail.slice(0,35));
	   usemail=usemail.substr(35);
	}
	if (usemail.length) {
	  stringlist.push(usemail);
	}
	document.write(stringlist.join( '<br>' ));
}

// pre-load all images into cache
function preloadImage(images) {
	if (images) {
		if (images.length) {
			for (i = 0; i < images.length; i++) {
				var tmpImage = new Image();
				tmpImage.src = images[i];
			}
		}
	}

}
function Loading() {
	preloadImage(new Array("/content/ebiz/debeers/resources/images/topnav/hdr_instore_on.gif", "/content/ebiz/debeers/resources/images/topnav/hdr_bridal_on.gif", "/content/ebiz/debeers/resources/images/topnav/hdr_collections_on.gif", "/content/ebiz/debeers/resources/images/topnav/hdr_highend_on.gif", "/content/ebiz/debeers/resources/images/topnav/hdr_bracelets_on.gif", "/content/ebiz/debeers/resources/images/topnav/hdr_cufflinks_on.gif", "/content/ebiz/debeers/resources/images/topnav/hdr_earrings_on.gif", "/content/ebiz/debeers/resources/images/topnav/hdr_necklaces_on.gif", "/content/ebiz/debeers/resources/images/topnav/hdr_pendants_on.gif", "/content/ebiz/debeers/resources/images/topnav/hdr_rings_on.gif", "/content/ebiz/debeers/resources/images/topnav/header_s.gif", "/content/ebiz/debeers/resources/images/topnav/header_l.gif"))
}
window.onload = Loading;

 

//variables for checking shipping country.
var country = new Array();
var countrycount =0;

//Description: Returns the value of a specified URL parameter
//Parameters:
//1. currURL = this is the URL which you wish to get the URL parameter value from
//2. urlParam = this is the name of the URL parameter you want to get the value for
//Returns: value for parameter specified urlParam.
function grabURL(currURL,urlParam) {
//find out a value where is passed from current url
var url = unescape(currURL);
var spliter = '&';
var sField = spliter+urlParam+'=';

if (url.search(sField) == -1) {
sField = '?'+urlParam+'=';
}

var urlArray = url.split(sField);
if (urlArray[1]) {
//get url param value
var paramArray = urlArray[1].split(spliter);
return(paramArray[0]);
}
}

function addOnloadEvent(fnc) {
    if ( typeof window.addEventListener != "undefined" )
        window.addEventListener( "load", fnc, false );
    else if ( typeof window.attachEvent != "undefined" ) {
        window.attachEvent( "onload", fnc );
    }
    else {
         if ( window.onload != null ) {
         var oldOnload = window.onload;
            window.onload = function ( e ) {
            oldOnload( e );
            window[fnc]();
            };
        }
        else
            window.onload = fnc;
    }
}
var Ldesp=''; // long description display for search category list