var rootPath = '/Promo-new/';

var whileCount=0;

function initMenus(){
 if(menu_items_total)for(z=1;z<parseInt(menu_items_total)+1;z++)drawMenu(z);
}
function Jump(url){
 if(url){
	if(url.indexOf('http://')!=-1){
		
	}else{
		if(url.indexOf('alert')!=-1){
			eval(url)
		}else{
			document.location.href=url;
		}
	}
  }
}
function drawMenu(num,c){
                 
	if(eval('menu'+num+'_itemsArray.length')>0){
	document.write('<div style=" z-index:2; width:130px; " id="menu_table'+num+'" class=menuClass onmouseover="clearTimeout(navTimeout),LAYER_changeVisibility(active_menu,1); " onmouseout="changeDelay(active_menu);"><img src="../Images/line_top.gif" width=130 height=3 border=0>');
 
 	for(x=0;x<eval('menu'+num+'_itemsArray.length');x++){
 		document.write('<div style="width:130px;  z-index:2; " id="menu"'+num+'-'+x+'" class="submenuItem"  onmouseout="lowlightItem(this,roll_bg_locolor)\;" onmouseover="lowlightItem(this,roll_bg_hicolor)\;"><table width=130 border=0 cellpadding=0 cellspacing=0><tr><td height='+menuHeight+' background="../Images/line.gif" width=1></td><td  align="center">');

		
			if(eval('menu'+num+'_urlsArray['+x+']')!='None'){
				document.write('<a class=navlink onClick="window.status=\'Promo-M\';return true" onMouseOver="window.status=\'Promo-M\';return true" href="javascript:Jump(eval(\'menu'+num+'_urlsArray['+x+']\'\))">' + eval('menu'+num+'_itemsArray['+x+']')+ '</a><td background="../Images/line.gif" width=1</td>') ;
				
			}else{
				document.write(eval('menu'+num+'_itemsArray['+x+']')) ;
				
			}
	
 		document.write(' </td></td></tr></table></div>');
		
		if(x+1<eval('menu'+num+'_itemsArray.length'))document.write('<img class="block" src="../Images/line.gif" width=130 height=1 border=0>');
 		
		
 	}
		
 	document.write('<img class="block" src="../Images/line.gif" width=130 height=1 border=0></div>');
 	}
 };




function findPosX(obj){
	var curleft = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){curleft += obj.offsetLeft;obj = obj.offsetParent;}
	}else if (obj.x)
		curleft += obj.x;
		return curleft;
};
function findPosY(obj){
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
};
function setLyr(obj,lyr,ox,oy){
	var newX = findPosX(obj);
	var newY = findPosY(obj);
	var newL = new LAYER_findObj(lyr);
	
	
	if(lyr=='menu_table2')LAYER_changeVisibility('merchpull', 0)
	
	if(newL.style){
		newL.style.top = (parseInt(newY) + parseInt(oy)) + 'px'
		newL.style.left = (parseInt(newX) + parseInt(ox)) + 'px'
	}
	
};

function delayHideSubnav() {
   hideSubnavTimeout = setTimeout("hideCurrentSubnav();", timeoutDelay);
};


function hiliteTD(obj, bgcolor,cursor) {
	if(obj.style){
   		obj.style.backgroundColor = bgcolor;
   		//obj.style.cursor=cursor;
   	}
}

function lowlightItem(obj, bgcolor) {
   obj.style.color = '#ffffff';
   obj.style.fontWeight = 'normal';
   obj.style.backgroundColor = bgcolor;
}


function changeDelay( oTime) {
		
		navTimeout = setTimeout("LAYER_changeVisibility(active_menu, 0);", oTime);
		
}

var memberid=getInfo(0) || 0;
var age=getInfo(1) || 0;
var sessionid=getInfo(2) || 0;



//..................................................................................

//..................................................................................

//..................................................................................



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




       
/**************  MOUSE EVENTS ***********************************************************/
function initMouseEvents() {
	document.onmousedown = mouseDown
	document.onmousemove = mouseMove
	document.onmouseup = mouseUp
	if (isNS4) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP)
}
function mouseDown(e) {
	if ((is.ns && e.which!=1) || (is.ie && event.button!=1)) return true
	var x = (is.ns)? e.pageX : event.x+document.body.scrollLeft
	var y = (is.ns)? e.pageY : event.y+document.body.scrollTop
	if (is.ns && e.target!=document) routeEvent(e)
	if (Scroll && ScrollTestActive()) return false
	else if (Drag && drag.mouseDown(x,y)) return false
	else return DynMouseDown(x,y)
}
function mouseMove(e) {
	var x = (is.ns)? e.pageX : event.x+document.body.scrollLeft
	var y = (is.ns)? e.pageY : event.y+document.body.scrollTop
	if (is.ns && e.target!=document) routeEvent(e)
	if (Scroll && ScrollTestActive()) return false
	else if (Drag && drag.mouseMove(x,y)) return false
	else return DynMouseMove(x,y)
}
function mouseUp(e) {
	var x = (is.ns)? e.pageX : event.x+document.body.scrollLeft
	var y = (is.ns)? e.pageY : event.y+document.body.scrollTop
	if (is.ns && e.target!=document) routeEvent(e)
	if (Drag && drag.mouseUp(x,y)) return false
	else return DynMouseUp(x,y)
}
function DynMouseDown(x,y) {
	//return true
}
function DynMouseMove(x,y) {
	//return true
}
function DynMouseUp(x,y,e) {
	if(ready == 0){
		//if(confirm('The last process has not finished, do you want to cancel it?'))return false
		alert('The last process has not finished, please wait a couple of seconds before proceeding.')
		return false
	}
	return true
}
/**************  MOUSE EVENTS ***********************************************************/

/**************  LAYERS ***********************************************************/
function LAYER_findObj( oName, oFrame, oDoc ) {
	if( !oDoc ) { if( oFrame ) { oDoc = oFrame.document; } else { oDoc = window.document; } }
	if( oDoc[oName] ) { return oDoc[oName]; } if( oDoc.all && oDoc.all[oName] ) { return oDoc.all[oName]; }
	if( oDoc.getElementById && oDoc.getElementById(oName) ) { return oDoc.getElementById(oName); }
	for( var x = 0; x < oDoc.forms.length; x++ ) { if( oDoc.forms[x][oName] ) { return oDoc.forms[x][oName]; } }
	for( x = 0; x < oDoc.anchors.length; x++ ) { if( oDoc.anchors[x].name == oName ) { return oDoc.anchors[x]; } }
	for( x = 0; document.layers && x < oDoc.layers.length; x++ ) {
		var theOb = LAYER_findObj( oName, null, oDoc.layers[x].document ); if( theOb ) { return theOb; } }
	if( !oFrame && window[oName] ) { return window[oName]; } if( oFrame && oFrame[oName] ) { return oFrame[oName]; }
	for( var x = 0; oFrame && oFrame.frames && x < oFrame.frames.length; x++ ) {
		var theOb = LAYER_findObj( oName, oFrame.frames[x], oFrame.frames[x].document ); if( theOb ) { return theOb; } }
	return null;
}
function handleVisibility( oName, oVis,oTime, oFrame ) {
		LAYER_changeVisibility(active_menu, 0)
		LAYER_changeVisibility(oName, 1)
		active_menu=oName;
}
function LAYER_changeVisibility( oName, oVis,oTime, oFrame ) {
	var theDiv = LAYER_findObj( oName, oFrame ); 
	if( !theDiv ) { return;  }
	if( theDiv.style ) {theDiv.style.visibility = oVis ? 'visible' : 'hidden';} else { theDiv.visibility = oVis ? 'show' : 'hide'; }
	if( theDiv.style ) { if(oVis=='hidden'){theDiv.style.top=-1000;}}
}
function LAYER_getLocation( oName, oXPos, oYPos, oRel, oFrame ) {
	var theDiv = LAYER_findObj( oName, oFrame ); if( !theDiv ) { return; }
	if( theDiv.style ) { theDiv = theDiv.style; } var oPix = document.childNodes ? 'px' : 0;
	if( (typeof( oXPos ) == 'number') && (typeof( oYPos ) == 'number'  ) ) { return (theDiv.left) }
}
function LAYER_changePosition( oName, oXPos, oYPos, oRel, oFrame ) {
	var theDiv = LAYER_findObj( oName, oFrame ); if( !theDiv ) { return; }
	if( theDiv.style ) { theDiv = theDiv.style; } var oPix = document.childNodes ? 'px' : 0;
	alert(theDiv.left)
	if( typeof( oXPos ) == 'number' ) { theDiv.left = ( oXPos + ( oRel ? 0 : parseInt( theDiv.left ) ) ) + oPix; }
	if( typeof( oYPos ) == 'number' ) { theDiv.top = ( oYPos + ( oRel ? 0 : parseInt( theDiv.top ) ) ) + oPix; }
}
function LAYER_changeZIndex( oName, ozInd, oFrame ) {
	var theDiv = LAYER_findObj( oName, oFrame ); if( !theDiv ) { return; }
	if( theDiv.style ) { theDiv = theDiv.style; } theDiv.zIndex = ozInd;
}
function LAYER_changeBackground( oName, oColour, oFrame ) {
	var theDiv = LAYER_findObj( oName, oFrame ); if( !theDiv ) { return; }
	if( theDiv.style ) { theDiv = theDiv.style; } if( typeof( theDiv.bgColor ) != 'undefined' ) {
		theDiv.bgColor = oColour; } else if( theDiv.backgroundColor ) { theDiv.backgroundColor = oColour; }
	else { theDiv.background = oColour; }
}
function LAYER_changeDisplay( oName, oDisp, oFrame ) {
	var theDiv = LAYER_findObj( oName, oFrame ); if( !theDiv ) { return; }
	if( theDiv.style ) { theDiv = theDiv.style; } if( typeof( oDisp ) == 'string' ) { oDisp = oDisp.toLowerCase(); }
	theDiv.display = ( oDisp == 'none' ) ? 'none' : ( oDisp == 'block' ) ? 'block' : ( oDisp == 'inline' ) ? 'inline' : '';
}
function LAYER_changeSize( oName, oWidth, oHeight, oFrame ) {
	var theDiv = LAYER_findObj( oName, oFrame ); if( !theDiv ) { return; }
	if( theDiv.style ) { theDiv = theDiv.style; } var oPix = document.childNodes ? 'px' : 0;
	if( theDiv.resizeTo ) { theDiv.resizeTo( oWidth, oHeight ); }
	theDiv.width = oWidth + oPix; theDiv.pixelWidth = oWidth;
	theDiv.height = oHeight + oPix; theDiv.pixelHeight = oHeight;
}
function LAYER_changeClip( oName, oLeft, oTop, oBottom, oRight, oFrame ) {
	var theDiv = LAYER_findObj( oName, oFrame ); if( !theDiv ) { return; }
	if( theDiv.clip ) { theDiv = theDiv.clip; theDiv.top = oTop; theDiv.right = oRight; theDiv.bottom = oBottom; theDiv.left = oLeft; }
	if( theDiv.style ) { theDiv.style.clip = 'rect('+oTop+'px '+oRight+'px '+oBottom+'px '+oLeft+'px)'; }
}
function LAYER_changeContents( oName, oContents, oIframe, oFrame ) {
	var theDiv = LAYER_findObj( oName, oFrame ); if( !theDiv ) { theDiv = new Object(); } if( !oFrame ) { oFrame = window; }
	if( typeof( theDiv.innerHTML ) != 'undefined' ) { theDiv.innerHTML = oContents; }
	else if( theDiv.document && theDiv.document != oFrame.document ) {
		theDiv = theDiv.document; theDiv.open(); theDiv.write( oContents ); theDiv.close(); }
	else if( oIframe && oFrame.frames && oFrame.frames.length && oFrame.frames[oIframe] ) {
		theDiv = oFrame.frames[oIframe].window.document; theDiv.open(); theDiv.write( oContents ); theDiv.close(); }
}
function LAYER_createNew( oName, oWidth, oNewID, oFrame ) {
	if( document.layers && window.Layer ) {
		var theOldLayer = oName ? LAYER_findObj( oName, oFrame ) : oFrame ? oFrame : window; if( !theOldLayer ) { return; }
		theOldLayer.document.layers[oNewID] = new Layer( oWidth, theOldLayer );
	} else {
		var theOldLayer = oName ? LAYER_findObj( oName, oFrame ) : oFrame ? oFrame.document.body : document.body; if( !theOldLayer ) { return; }
		var theString = '<div id="'+oNewID+'" style="position:absolute;width:'+oWidth+'px;visibility:hidden;"></div>';
		if( theOldLayer.insertAdjacentHTML ) { theOldLayer.insertAdjacentHTML('beforeEnd',theString);
		} else if( typeof( theOldLayer.innerHTML ) != 'undefined' ) { theOldLayer.innerHTML += theString; }
	}
}
function LAYER_getStyle( oName, oStyle, oFrame ) {
	if( oName == 'document' ) {
		var theBody = oFrame ? oFrame.document : window.document;
		if( theBody.documentElement && theBody.documentElement.style && theBody.documentElement.style.backgroundColor ) { return theBody.documentElement.style.backgroundColor; }
		if( theBody.body && theBody.body.style && theBody.body.style.backgroundColor ) { return theBody.body.style.backgroundColor; }
		if( theBody.documentElement && theBody.documentElement.style && theBody.documentElement.style.background ) { return theBody.documentElement.style.background; }
		if( theBody.body && theBody.body.style && theBody.body.style.background ) { return theBody.body.style.background; }
		if( theBody.bgColor ) { return theBody.bgColor; }
		return '#ffffff';
	}
	var theDiv = LAYER_findObj( oName, oFrame ); if( !theDiv ) { return null; } if( theDiv.style && oStyle != 'clip' ) { theDiv = theDiv.style; }
	switch( oStyle ) {
		case 'visibility':
			return ( ( theDiv.visibility && !( theDiv.visibility.toLowerCase().indexOf( 'hid' ) + 1 ) ) ? true : false );
		case 'left':
			return ( parseInt( theDiv.left ) ? parseInt( theDiv.left ) : 0 );
		case 'top':
			return ( parseInt( theDiv.top ) ? parseInt( theDiv.top ) : 0 );
		case 'zIndex':
			return ( isNaN( theDiv.zIndex ) ? 0 : theDiv.zIndex );
		case 'background':
			return ( theDiv.bgColor ? theDiv.bgColor : theDiv.background-color ? theDiv.background-color : theDiv.background );
		case 'display':
			return ( theDiv.display ? theDiv.display : '' );
		case 'size':
			if( typeof( theDiv.pixelWidth ) != 'undefined' ) { return [theDiv.pixelWidth,theDiv.pixelHeight]; }
			if( typeof( theDiv.width ) != 'undefined' ) { return [parseInt(theDiv.width),theDiv.parseInt(height)]; }
			if( theDiv.clip && typeof( theDiv.clip.bottom ) == 'number' ) { return [theDiv.clip.right,theDiv.clip.bottom]; }
			return [0,0];
		case 'clip':
			if( theDiv.clip ) { return theDiv.clip; }
			theDiv = ( theDiv.style && theDiv.style.clip ) ? theDiv.style.clip : 'rect()';
			theDiv = theDiv.substr( theDiv.indexOf( '(' ) + 1 ); var theClip = new Object();
			for( var x = 0, y = ['top','right','bottom','left']; x < 4; x++ ) {
				theClip[y[x]] = parseInt( theDiv ); if( isNaN( theClip[y[x]] ) ) { theClip[y[x]] = 0; }
				theDiv = theDiv.substr( theDiv.indexOf( ( theDiv.indexOf( ' ' ) + 1 ) ? ' ' : ( theDiv.indexOf( '	' ) + 1 ) ? '	' : ',' ) + 1 );
			} return theClip;
		default:
			return null;
	}
}
function LAYER_changeBody( oColour, oFrame ) { if( !oFrame ) { oFrame = window; }
	if( document.documentElement && document.documentElement.style ) {
		oFrame.document.documentElement.style.backgroundColor = oColour; }
	if( document.body && document.body.style ) { oFrame.document.body.style.backgroundColor = oColour; }
	oFrame.document.bgColor = oColour;
}
function LAYER_getPosition( oLink ) {
	if( oLink.offsetParent ) { for( var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent ) {
		posX += oLink.offsetLeft; posY += oLink.offsetTop; } return [ posX, posY ];
	} else { if( !oLink.x && !oLink.y ) { return [0,0]; } else { return [ oLink.x, oLink.y ]; } }
}
function LAYER_getSize( oFrame ) {
	if( !oFrame ) { oFrame = window; } var myWidth = 0, myHeight = 0;
	if( typeof( oFrame.innerWidth ) == 'number' ) { myWidth = oFrame.innerWidth; myHeight = oFrame.innerHeight; }
	else if( oFrame.document.documentElement && ( oFrame.document.documentElement.clientWidth || oFrame.document.documentElement.clientHeight ) ) {
		myWidth = oFrame.document.documentElement.clientWidth; myHeight = oFrame.document.documentElement.clientHeight; }
	else if( oFrame.document.body && ( oFrame.document.body.clientWidth || oFrame.document.body.clientHeight ) ) {
		myWidth = oFrame.document.body.clientWidth; myHeight = oFrame.document.body.clientHeight; }
	return [myWidth,myHeight];
}
function LAYER_getScroll( oFrame ) {
	if( !oFrame ) { oFrame = window; } var scrOfX = 0, scrOfY = 0;
	if( typeof( oFrame.pageYOffset ) == 'number' ) { scrOfY = oFrame.pageYOffset; scrOfX = oFrame.pageXOffset; }
	else if( oFrame.document.documentElement && ( oFrame.document.documentElement.scrollLeft || oFrame.document.documentElement.scrollTop ) ) {
		scrOfY = oFrame.document.documentElement.scrollTop; scrOfX = oFrame.document.documentElement.scrollLeft; }
	else if( oFrame.document.body && ( oFrame.document.body.scrollLeft || oFrame.document.body.scrollTop ) ) {
		scrOfY = oFrame.document.body.scrollTop; scrOfX = oFrame.document.body.scrollLeft; }
	return [scrOfX,scrOfY];
}
function LAYER_monitorMouse(oFunc) {
	if( document.captureEvents && Event.MOUSEMOVE ) { document.captureEvents( Event.MOUSEMOVE ); }
	window.LAYER_getMouse = [0,0]; window.LAYERstoreFunc = oFunc;
	document.onmousemove = function (e) { window.LAYER_getMouse = LAYER_getMouseCoords(e); if( window.LAYERstoreFunc ) { window.LAYERstoreFunc(); } };
}
function LAYER_getMouseCoords(e) {
	if( !e ) { e = window.event; } if( !e || ( typeof( e.pageX ) != 'number' && typeof( e.clientX ) != 'number' ) ) { return[0,0]; }
	if( typeof( e.pageX ) == 'number' ) { var xcoord = e.pageX; var ycoord = e.pageY; } else {
		var xcoord = e.clientX; var ycoord = e.clientY;
		if( !( ( window.navigator.userAgent.indexOf( 'Opera' ) + 1 ) || ( window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1 ) || window.navigator.vendor == 'KDE' ) ) {
			if( document.documentElement && ( document.documentElement.scrollTop || document.documentElement.scrollLeft ) ) {
				xcoord += document.documentElement.scrollLeft; ycoord += document.documentElement.scrollTop;
			} else if( document.body && ( document.body.scrollTop || document.body.scrollLeft ) ) {
				xcoord += document.body.scrollLeft; ycoord += document.body.scrollTop;
			} } } return [xcoord,ycoord];
}
function LAYER_monitorKey( oOb, oEvent, oHandler ) {
	if( oOb.captureEvents && Event[oEvent.toUpperCase()] ) { oOb.captureEvents( Event[oEvent.toUpperCase()] ); }
	oOb['on'+oEvent.toLowerCase()] = function (e) { if( !e ) { e = window.event; }
		if( !e ) { return; } var oHandler = this['LAYER_'+e.type.toLowerCase()];
		e = ( typeof( e.which ) == 'number' ) ? e.which : ( ( typeof( e.keyCode ) == 'number' ) ? e.keyCode : ( ( typeof( e.charCode ) == 'number' ) ? e.charCode : 0 ) );
		if( oHandler ) { oHandler( arguments[0], e, String.fromCharCode( e ), this ); }
	}; oOb['LAYER_'+oEvent.toLowerCase()] = oHandler;
}
function LAYER_monitorButton( oOb, oEvent, oHandler ) {
	if( oOb.captureEvents && Event[oEvent.toUpperCase()] ) { oOb.captureEvents( Event[oEvent.toUpperCase()] ); }
	oOb['on'+oEvent.toLowerCase()] = function (e) { if( !e ) { e = window.event; }
		if( !e ) { return; } var oHandler = this['LAYER_'+e.type.toLowerCase()];
		if( typeof( e.which ) == 'number' ) { e = e.which; } else { e = e.button; }
		if( oHandler ) { oHandler( arguments[0], e, ( ( e < 2 ) ? 'left' : 'right' ), this ); }
	}; oOb['LAYER_'+oEvent.toLowerCase()] = oHandler;
}


