function popup(url,width,height,name) {
	if (width == '' || width == null) width = 620;
	if (height == ''|| height == null) height = 640;
	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 > 30) {
	   stringlist.push( usemail.slice(0,30));
	   usemail=usemail.substr(30);
	}
	if (usemail.length) {
	  stringlist.push(usemail);
	}
	document.write(stringlist.join( '<br>' ));
}

//set the same height
function setequalheight(oElm, strTagName, oClassNames){
            var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
            var arrReturnElements = new Array();
            var arrRegExpClassNames = new Array();
            if(typeof oClassNames == "object"){
                        for(var i=0; i<oClassNames.length; i++){
                                    arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
                        }
            }
            else{
                        arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));
            }
            var oElement;
            var bMatchesAll;
            for(var j=0; j<arrElements.length; j++){
                        oElement = arrElements[j];
                        bMatchesAll = true;
                        for(var k=0; k<arrRegExpClassNames.length; k++){
                                    if(!arrRegExpClassNames[k].test(oElement.className)){
                                                bMatchesAll = false;
                                                break;
                                    }
                        }
                        if(bMatchesAll){
                                    arrReturnElements.push(oElement);
                        }
            }
            //return (arrReturnElements)
            var divs = arrReturnElements;
            //alert (divs.length);
            var maxHeight=0;
            for(i=0;i<divs.length;i++){
                        //alert(a[i].offsetHeight);
                        maxHeight = Math.max(maxHeight,divs[i].offsetHeight);
            }
            for(i=0;i<divs.length;i++){
                        if(navigator.appName == "Microsoft Internet Explorer"){
		var version = navigator.appVersion;
		var versnum = version.split("MSIE");
		var versnumber = versnum[1].substring(0,2);
		if(versnumber > 6){
		/*  IE7 only */
		     divs[i].style.minHeight=maxHeight + "px";
		}
		else{
		/* IE6 and the less */
		     divs[i].style.height=maxHeight + "px";
		}																
                        }else{
                                    divs[i].style.minHeight=maxHeight + "px";
                        }
            }
}
// Array support for the push method in IE 5
if(typeof Array.prototype.push != "function"){
            Array.prototype.push = ArrayPush;
            function ArrayPush(value){
                        this[this.length] = value;
            }
}

//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;
    }
}