// mBanner.js
/////////////////////////////////
// File Name: mBanner.js      //
// By: Manish Kumar Namdeo    //
/////////////////////////////////

// BANNER OBJECT
function Banner(objName){
        this.obj = objName;
        this.aNodes = [];
        this.currentBanner = 0;
       
};

// ADD NEW BANNER
Banner.prototype.add = function(bannerType, bannerPath, bannerDuration, height, width, hyperlink) {
        this.aNodes[this.aNodes.length] = new Node(this.obj +"_"+ this.aNodes.length, bannerType, bannerPath, bannerDuration, height, width, hyperlink);
};

// Node object
function Node(name, bannerType, bannerPath, bannerDuration, height, width, hyperlink) {
        this.name = name;
        this.bannerType = bannerType;
        this.bannerPath = bannerPath;
        this.bannerDuration = bannerDuration;
        this.height = height
        this.width = width;
        this.hyperlink= hyperlink;
//        alert (name +"|" + bannerType +"|" + bannerPath +"|" + bannerDuration +"|" + height +"|" + width + "|" + hyperlink);
};

// Outputs the banner to the page
Banner.prototype.toString = function() {
        var str = ""
        for (var iCtr=0; iCtr < this.aNodes.length; iCtr++){
                str = str + '<span name="'+this.aNodes[iCtr].name+'" '
                str = str + 'id="'+this.aNodes[iCtr].name+'" ';
                str = str + 'class="m_banner_hide" ';
                str = str + 'bgcolor="#FFFCDA" ';        // CHANGE BANNER COLOR HERE
                str = str + 'align="center" ';
                str = str + 'valign="top" >\n';
                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '<a href="'+this.aNodes[iCtr].hyperlink+'" target="_blank">';
                }
                       
                if ( this.aNodes[iCtr].bannerType == "FLASH" ){
                        str = str + '<OBJECT '
                        str = str + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
                        str = str + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'id="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="" '
                        str = str + 'VIEWASTEXT>'
                        str = str + '<PARAM NAME=movie VALUE="'+ this.aNodes[iCtr].bannerPath + '">'
                        str = str + '<PARAM NAME=quality VALUE=high>'
                        str = str + '<PARAM NAME=bgcolor VALUE=#FFFCDA>'
                        str = str + '<EMBED ';
                        str = str + 'src="'+this.aNodes[iCtr].bannerPath+'" '
                        str = str + 'quality=high '
//                        str = str + 'bgcolor=#FFFCDA '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'NAME="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="center"  wmode="transparent"  '
                        str = str + 'TYPE="application/x-shockwave-flash" '
                        str = str + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
                        str = str + '</EMBED>'
                        str = str + '</OBJECT>'
                }else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){
                        str = str + '<img src="'+this.aNodes[iCtr].bannerPath+'" ';
                        str = str + 'border="0" ';
                        str = str + 'height="'+this.aNodes[iCtr].height+'" ';
                        str = str + 'width="'+this.aNodes[iCtr].width+'">';
                }

                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '</a>';
                }

                str += '</span>';
        }
        return str;
};

// START THE BANNER ROTATION
Banner.prototype.start = function(){
        this.changeBanner();
        var thisBannerObj = this.obj;
        // CURRENT BANNER IS ALREADY INCREMENTED IN cahngeBanner() FUNCTION
        setTimeout(thisBannerObj+".start()", this.aNodes[this.currentBanner].bannerDuration * 1000);
}

// CHANGE BANNER
Banner.prototype.changeBanner = function(){
        var thisBanner;
        var prevBanner = -1;
        if (this.currentBanner < this.aNodes.length ){
                thisBanner = this.currentBanner;
                if (this.aNodes.length > 1){
                        if ( thisBanner > 0 ){
                                prevBanner = thisBanner - 1;
                        }else{
                                prevBanner = this.aNodes.length-1;
                        }
                }
                if (this.currentBanner < this.aNodes.length - 1){
                        this.currentBanner = this.currentBanner + 1;
                }else{
                        this.currentBanner = 0;
                }
        }
       

        if (prevBanner >= 0){
                document.getElementById(this.aNodes[prevBanner].name).className = "m_banner_hide";
        }
        document.getElementById(this.aNodes[thisBanner].name).className = "m_banner_show";
}


// d_Banner
// Written by Dungpt
function d_Banner(objName){
        this.obj = objName;
        this.aNodes = [];
        this.currentBanner = 0;
       
};
// ADD NEW BANNER
d_Banner.prototype.add = function(bannerType, bannerPath, height, width, hyperlink) {
		var bannerDuration = 0;
        this.aNodes[this.aNodes.length] = new Node(this.obj +"_"+ this.aNodes.length, bannerType, bannerPath, bannerDuration, height, width, hyperlink);
};
// Outputs the banner to the page
d_Banner.prototype.toString = function() {
        var str = "";
		var BannerPostion = Math.floor(Math.random()*12321) % this.aNodes.length;
        for (var iCtr=BannerPostion; iCtr < this.aNodes.length; iCtr++){
                str = str + '<span name="'+this.aNodes[iCtr].name+'" '
                str = str + 'id="'+this.aNodes[iCtr].name+'" ';
                str = str + 'class="d_banner_show" ';
                str = str + 'bgcolor="#FFFCDA" ';        // CHANGE BANNER COLOR HERE
                str = str + 'align="center" ';
                str = str + 'valign="top" >\n';
                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '<a href="'+this.aNodes[iCtr].hyperlink+'" target="_blank">';
                }
                       
                if ( this.aNodes[iCtr].bannerType == "FLASH" ){
                        str = str + '<OBJECT '
                        str = str + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
                        str = str + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'id="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="" '
                        str = str + 'VIEWASTEXT>'
                        str = str + '<PARAM NAME=movie VALUE="'+ this.aNodes[iCtr].bannerPath + '">'
                        str = str + '<PARAM NAME=quality VALUE=high>'
                        str = str + '<PARAM NAME=bgcolor VALUE=#FFFCDA>'
                        str = str + '<EMBED ';
                        str = str + 'src="'+this.aNodes[iCtr].bannerPath+'" '
                        str = str + 'quality=high '
//                        str = str + 'bgcolor=#FFFCDA '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'NAME="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="center" wmode="transparent" '
                        str = str + 'TYPE="application/x-shockwave-flash" '
                        str = str + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
                        str = str + '</EMBED>'
                        str = str + '</OBJECT>'
                }else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){
                        str = str + '<img src="'+this.aNodes[iCtr].bannerPath+'" ';
                        str = str + 'border="0" ';
                        str = str + 'height="'+this.aNodes[iCtr].height+'" ';
                        str = str + 'width="'+this.aNodes[iCtr].width+'">';
                }
				if( this.aNodes[iCtr].bannerType == "TEXT") {
					str = str + '<iframe width="'+this.aNodes[iCtr].width+'" height="'+this.aNodes[iCtr].height+'" src="'+this.aNodes[iCtr].bannerPath+'" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>'
				}

                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '</a>';
                }

                str += '</span>';
        }
		for (var iCtr=0; iCtr < BannerPostion; iCtr++){
                str = str + '<span name="'+this.aNodes[iCtr].name+'" '
                str = str + 'id="'+this.aNodes[iCtr].name+'" ';
                //str = str + 'class="m_banner_hide" ';
                str = str + 'bgcolor="#FFFCDA" ';        // CHANGE BANNER COLOR HERE
                str = str + 'align="center" ';
                str = str + 'valign="top" >\n';
                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '<a href="'+this.aNodes[iCtr].hyperlink+'" target="_blank">';
                }
                       
                if ( this.aNodes[iCtr].bannerType == "FLASH" ){
                        str = str + '<OBJECT '
                        str = str + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
                        str = str + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'id="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="" '
                        str = str + 'VIEWASTEXT>'
                        str = str + '<PARAM NAME=movie VALUE="'+ this.aNodes[iCtr].bannerPath + '">'
                        str = str + '<PARAM NAME=quality VALUE=high>'
                        str = str + '<PARAM NAME=bgcolor VALUE=#FFFCDA>'
                        str = str + '<EMBED ';
                        str = str + 'src="'+this.aNodes[iCtr].bannerPath+'" '
                        str = str + 'quality=high '
//                        str = str + 'bgcolor=#FFFCDA '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'NAME="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="center" '
                        str = str + 'TYPE="application/x-shockwave-flash" '
                        str = str + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
                        str = str + '</EMBED>'
                        str = str + '</OBJECT>'
                }else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){
                        str = str + '<img src="'+this.aNodes[iCtr].bannerPath+'" ';
                        str = str + 'border="0" ';
                        str = str + 'height="'+this.aNodes[iCtr].height+'" ';
                        str = str + 'width="'+this.aNodes[iCtr].width+'">';
                }
				if( this.aNodes[iCtr].bannerType == "TEXT") {
					str = str + '<iframe width="'+this.aNodes[iCtr].width+'" height="'+this.aNodes[iCtr].height+'" src="'+this.aNodes[iCtr].bannerPath+'" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>'
				}

                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '</a>';
                }

                str += '</span>';
        }
        return str;
};

// d_Banner
// Written by Dungpt
function dFloat_Banner(objName){
        this.obj = objName;
        this.aNodes = [];
        this.currentBanner = 0;
       
};
// ADD NEW BANNER
dFloat_Banner.prototype.add = function(bannerType, bannerPath, height, width, hyperlink) {
		var bannerDuration = 0;
        this.aNodes[this.aNodes.length] = new Node(this.obj +"_"+ this.aNodes.length, bannerType, bannerPath, bannerDuration, height, width, hyperlink);
};
// Outputs the banner to the page
dFloat_Banner.prototype.toString = function() {
        var str = "";
		var BannerPostion = Math.floor(Math.random()*12321) % this.aNodes.length;
        for (var iCtr=BannerPostion; iCtr < this.aNodes.length; iCtr++){
                str = str + '<span name="'+this.aNodes[iCtr].name+'" '
                str = str + 'id="'+this.aNodes[iCtr].name+'" ';
                //str = str + 'class="m_banner_hide" ';
                str = str + 'bgcolor="#FFFCDA" ';        // CHANGE BANNER COLOR HERE
                str = str + 'align="center" ';
                str = str + 'valign="top" >\n';
                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '<a href="'+this.aNodes[iCtr].hyperlink+'" target="_blank">';
                }
                       
                if ( this.aNodes[iCtr].bannerType == "FLASH" ){
                        str = str + '<OBJECT '
                        str = str + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
                        str = str + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'id="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="" '
                        str = str + 'VIEWASTEXT>'
                        str = str + '<PARAM NAME=movie VALUE="'+ this.aNodes[iCtr].bannerPath + '">'
                        str = str + '<PARAM NAME=quality VALUE=high>'
                        str = str + '<PARAM NAME=bgcolor VALUE=#FFFCDA>'
                        str = str + '<EMBED ';
                        str = str + 'src="'+this.aNodes[iCtr].bannerPath+'" '
                        str = str + 'quality=high '
//                        str = str + 'bgcolor=#FFFCDA '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'NAME="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="center" '
                        str = str + 'TYPE="application/x-shockwave-flash" '
                        str = str + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
                        str = str + '</EMBED>'
                        str = str + '</OBJECT>'
                }else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){
                        str = str + '<img src="'+this.aNodes[iCtr].bannerPath+'" ';
                        str = str + 'border="0" ';
                        str = str + 'height="'+this.aNodes[iCtr].height+'" ';
                        str = str + 'width="'+this.aNodes[iCtr].width+'">';
                }
				if( this.aNodes[iCtr].bannerType == "TEXT") {
					str = str + '<iframe width="'+this.aNodes[iCtr].width+'" height="'+this.aNodes[iCtr].height+'" src="'+this.aNodes[iCtr].bannerPath+'" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>'
				}

                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '</a>';
                }

                str += '</span>';
        }
		for (var iCtr=0; iCtr < BannerPostion; iCtr++){
                str = str + '<span name="'+this.aNodes[iCtr].name+'" '
                str = str + 'id="'+this.aNodes[iCtr].name+'" ';
                //str = str + 'class="m_banner_hide" ';
                str = str + 'bgcolor="#FFFCDA" ';        // CHANGE BANNER COLOR HERE
                str = str + 'align="center" ';
                str = str + 'valign="top" >\n';
                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '<a href="'+this.aNodes[iCtr].hyperlink+'" target="_blank">';
                }
                       
                if ( this.aNodes[iCtr].bannerType == "FLASH" ){
                        str = str + '<OBJECT '
                        str = str + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
                        str = str + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'id="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="" '
                        str = str + 'VIEWASTEXT>'
                        str = str + '<PARAM NAME=movie VALUE="'+ this.aNodes[iCtr].bannerPath + '">'
                        str = str + '<PARAM NAME=quality VALUE=high>'
                        str = str + '<PARAM NAME=bgcolor VALUE=#FFFCDA>'
                        str = str + '<EMBED ';
                        str = str + 'src="'+this.aNodes[iCtr].bannerPath+'" '
                        str = str + 'quality=high '
//                        str = str + 'bgcolor=#FFFCDA '
                        str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
                        str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
                        str = str + 'NAME="bnr_'+this.aNodes[iCtr].name+'" '
                        str = str + 'ALIGN="center" '
                        str = str + 'TYPE="application/x-shockwave-flash" '
                        str = str + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
                        str = str + '</EMBED>'
                        str = str + '</OBJECT>'
                }else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){
                        str = str + '<img src="'+this.aNodes[iCtr].bannerPath+'" ';
                        str = str + 'border="0" ';
                        str = str + 'height="'+this.aNodes[iCtr].height+'" ';
                        str = str + 'width="'+this.aNodes[iCtr].width+'">';
                }
				if( this.aNodes[iCtr].bannerType == "TEXT") {
					str = str + '<iframe width="'+this.aNodes[iCtr].width+'" height="'+this.aNodes[iCtr].height+'" src="'+this.aNodes[iCtr].bannerPath+'" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>'
				}

                if (this.aNodes[iCtr].hyperlink != ""){
                        str = str + '</a>';
                }

                str += '</span>';
        }
        return str;
};

function flashWrite(url,w,h,id,bg,vars){

     var flashStr=
    "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
    "<param name='allowScriptAccess' value='always' />"+
    "<param name='movie' value='"+url+"' />"+
    "<param name='FlashVars' value='"+vars+"' />"+
    "<param name='wmode' value='transparent' />"+
    "<param name='menu' value='false' />"+
    "<param name='quality' value='high' />"+
    "<embed src='"+url+"' FlashVars='"+vars+"' wmode='transparent' menu='false' quality='high' width='"+w+"' height='"+h+"' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
    "</object>";
    document.write(flashStr);
}

// menus_paul.js

/*----------------------------------------------------
// menus.js
//
//--------------------------------------------------*/

/*----------------------------------------------------
// Browser Detect
//--------------------------------------------------*/

var isNav, isIE, isNN6;

if (parseInt(navigator.appVersion) >= 4) {
	if (navigator.appName == "Netscape") {
		isNav = true;
		if(document.getElementById){
			isNN6=true;
		}
		else {
			isNN6=false;
		}
		
	} else {
		isIE = true;
	}
}

/*----------------------------------------------------
// Global variables
//--------------------------------------------------*/

// global list of all menuItems.
// Keeps track of menuItem ids and provides a quick
// method for grabbing the handle of a menuItem based
// on its id.
var menuItems = new Array();

// global list of all menuItemProps.
// Keeps track of menuItemProp ids and provides a quick
// method for grabbing the handle of a menuItemProp based
// on its id.
var menuItemProps = new Array();

var rootMenu = null;				// rootMenu
var timer;							// Timer.  Gives a pause before collapsing all menus.
var holdtime = 0;					// Pause time before collapsing all menus.
var image;
var imageName;

/*----------------------------------------------------
// Some global functions.
//--------------------------------------------------*/

/*----------------------------------------------------
// collapseRootMenu
//----------------------------------------------------
// Hides all open menus beginning with rootMenu.
//--------------------------------------------------*/

function collapseRootMenu() {

	if (rootMenu) {
		rootMenu.hide();
		rootMenu = null;
		collapseRootMenu()
//		turnOff(imageName)
		showStatus('')
	}
}


/*----------------------------------------------------
// openRootMenu
//----------------------------------------------------
// Opens a menu as the rootMenu.  Use this function
// to begin a cascading menu instead of calling the
// menu's show method directly.
//--------------------------------------------------*/

function openRootMenu(menu, left, top, z_index, image) {
	if (rootMenu) {
		collapseRootMenu();
	}
	
	// If the timer has been started, clear it.
	if (timer) {
		clearTimeout(timer);
	}
	
	// Assign menu as the rootMenu
	if (menu) {
		rootMenu = menu;
		rootMenu.expand(left, top, z_index, image);
		rootMenu.show(image);
		imageName = image	
		//timer = setTimeout("collapseRootMenu();", holdtime);	
	}
	
}


/*----------------------------------------------------
// menuItemProp Object
//--------------------------------------------------*/

/*----------------------------------------------------
// menuItemProp
//----------------------------------------------------
// Constructor for menuItemProp
// Describes display properties of a menuItem
//--------------------------------------------------*/

function menuItemProp(width, bgcolor, highlightcolor, borderwidth, imagesrc, imagewidth, css_attributes) {

	// Grab next menuItemProp id from global list.
	var id = menuItemProps.length;

	this.id = id;
	this.className = "menuProp" + id;

	this.width = width;
	this.bgcolor = bgcolor;
	this.highlightcolor = highlightcolor;
	this.borderwidth = borderwidth;
	this.imagesrc = imagesrc;
	this.imagewidth = imagewidth;
	
	// Establish style tag for this menuProp.
	var styleStr = "\n\n<STYLE TYPE='text/css'>\n";
	styleStr += "<!--\n";
	styleStr += "." + this.className + " {\n";
	
	for (var i in css_attributes) {
		styleStr += i + ": " + css_attributes[i] + ";\n";
	}
	
	styleStr += "}\n";
	styleStr += "// -->\n";
	styleStr += "</STYLE>\n";
 
	document.write(styleStr);
	
	menuItemProps[id] = this;			// Add to global list of menuItemProps.
	
	return this;
}


/*----------------------------------------------------
// menuItem Object and Related Functions
//--------------------------------------------------*/

/*----------------------------------------------------
// menuItem
//----------------------------------------------------
// Constructor for menuItem
//
// Pass in a label, a string to be evaluated as the
// onclick event handler (optional), a
// menuItemProp object and a handle to
// a subMenu (optional).
//
// The subMenu can be set later by assigning it to 
// the menuItem's subMenu property.  However,
// a "true" value must be passed to the constructor
// as the third parameter if you want the subMenu
// graphic to show on the menuItem.
//
//
// e.g.
//
//		var menu1 = new menuItem("Menu 1", "", menuItemProp, true);
//		var menu2 = new menuItem("Menu 2", "", menuItemProp, false);
//		menu1.subMenu = menu2;
//--------------------------------------------------*/

function menuItem(label, onclick, props, sub_menu) {

	// Grab next menuItem id from global list.
	var id = menuItems.length;
	var objTag = "";

	if (isIE || isNN6) {
		objTag += "<div id=\"" + id + "\"";
		objTag += " class=\"" + props.className + "\"";
		objTag += " style=\"";
		objTag += " position: absolute;";
		objTag += " visibility: hidden;";
		objTag += " left: 15;";
		objTag += " top: 0;";
		objTag += " width: " + props.width + ";";
		objTag += " background-color: " + props.bgcolor +";";
		objTag += " z-index: 0;";
		objTag += "\"";
		objTag += " onmouseover=\"menuItem_mouseover('" + id + "');\"";
		objTag += " onmouseout=\"menuItem_mouseout('" + id + "');\"";
		if (onclick) {
			objTag += " onclick=\"collapseRootMenu();" + onclick + "\"";
		}
		objTag += ">";
		if (sub_menu) {
			 objTag += "<img src=\"" + props.imagesrc + "\" border=\"0\" align=\"right\" width=\"" + props.imagewidth + "\" vspace=\"2\">"
		}
		objTag += "&#160;" + label
		objTag += "</nobr></div>";
	} else if (isNav){
		objTag += "<layer id=\"" + id + "\"";
		objTag += " class=\"" + props.className + "\"";
		objTag += " visibility=\"hidden\"";
		objTag += " left=0";
		objTag += " top=0";
		objTag += " width=" + props.width;
		objTag += " bgcolor=" + props.bgcolor;
		objTag += " z-index=0";
		objTag += " onmouseover=\"menuItem_mouseover('" + id + "');\"";
		objTag += " onmouseout=\"menuItem_mouseout('" + id + "');\"";
		if (onclick) {
			objTag += " onfocus=\"collapseRootMenu();" + onclick + "\"";
		}
		objTag += ">";
		if (sub_menu) {
			 objTag += "<img src=\"" + props.imagesrc + "\" border=\"0\" align=right width=\"" + props.imagewidth + "\" vspace=\"2\">"
		}
		objTag += "&#160;" + label
		objTag += "</layer>";
	}
	
	// Create object.
	document.write(objTag);

	this.obj = getMenuItem(id);		// Store a handle to the object we just created.
	this.id  = id;
	this.menu = null;				// The menu that the menuItem belongs to.
	this.subMenu = sub_menu;		// A subMenu to display beneath the menuItem.
	
	// Save the display properties that we need.
	this.bgcolor = props.bgcolor;
	this.highlightcolor = props.highlightcolor;
	this.borderwidth = props.borderwidth;

	menuItems[id] = this;			// Add to global list of menuItems.
	return this;
}


/*----------------------------------------------------
// getMenuItem
//----------------------------------------------------
// Grabs a handle to a menuItem's object based on id.
// Called by menuItem constructor.
//--------------------------------------------------*/

function getMenuItem(id) {
	if (isIE) {
		return eval("document.all(\"" + id + "\")");
	} else if (isNav) {
		if(isNN6)
			{
			return document.getElementById(''.concat(id));
			}
		else
			{
			return eval("document.layers[\"" + id + "\"]");
			}
	}
	return null;
}


/*----------------------------------------------------
// menuItem_mouseover
//----------------------------------------------------
// Event handler for menuItem mousovers.
// Is passed the id of the menuItem.
//--------------------------------------------------*/

function menuItem_mouseover(id) {
	// Clear timer to avoid collapse of all menus.
	clearTimeout(timer);

	var currMenuItem = menuItems[id];
	var currMenu = currMenuItem.menu;
	var obj = currMenuItem.obj;

	currMenu.setActiveMenuItem(currMenuItem);

	// If another subMenu is open for the current menu, close it.
	if (currMenu.openSubMenu) {
		currMenu.openSubMenu.hide();
		currMenu.openSubMenu = null;
	}

	// If there is a subMenu associated with this menuItem, open it.
	if (currMenuItem.subMenu) {
		if (currMenuItem.subMenu.width <= 0 || currMenuItem.subMenu.height <= 0) {
			currMenuItem.subMenu.calculateDimensions();
		}

		// Determine position for subMenu based on position of menuItem and current menu's direction.

		var left, top, z_index;
		
		var objLeft, objTop, objWidth, objHeight, objZIndex;
		var pageLeft, pageRight, pageTop, pageBottom;
		
		if (isIE) {
			objLeft = obj.style.pixelLeft;
			objTop = obj.style.pixelTop;
			objWidth = obj.offsetWidth;
			objHeight = obj.offsetHeight;
			objZIndex = obj.style.zIndex;
			pageLeft = document.body.scrollLeft;
			pageRight = document.body.clientWidth + document.body.scrollLeft;
			pageTop = document.body.scrollTop;
			pageBottom = document.body.clientHeight + document.body.scrollTop;
			} else if (isNav) {
			objLeft = obj.left;
			objTop = obj.top;
			objWidth = obj.clip.width;
			objHeight = obj.clip.height;
			objZIndex = obj.zIndex;
			pageLeft = pageXOffset;
			pageRight = window.innerWidth + pageXOffset;
			pageTop = pageYOffset;
			pageBottom = window.innerHeight + pageYOffset;
		}

		//if (currMenu.direction == "right" && (objLeft + objWidth - 4 + currMenuItem.subMenu.width > pageRight)) {
		if (currMenu.direction == "right" && (objLeft + 80 + currMenuItem.subMenu.width > pageRight) && (objLeft - 80 + objWidth - currMenuItem.subMenu.width >= pageLeft)) {
			currMenu.direction = "left";
		//} else if (currMenu.direction == "left" && (objLeft + 4 - currMenuItem.subMenu.width < pageLeft)) {
		} else if (currMenu.direction == "left" && (objLeft -80 < pageLeft) && (objLeft + 80 + currMenuItem.subMenu.width <= pageRight)) {
			currMenu.direction = "right";
		}
			
		currMenuItem.subMenu.direction = currMenu.direction;
			
		if (currMenu.direction == "right") {
			//left = objLeft + objWidth - 4;
			left = objLeft + 80;
		} else {
			//left = objLeft + 4 - currMenuItem.subMenu.width;
			left = objLeft - 80 + objWidth - currMenuItem.subMenu.width;
		}
		
		top = objTop + 20;
		
		while (top + currMenuItem.subMenu.height > pageBottom && top - objHeight + currMenuItem.borderwidth > pageTop) {
			top -= objHeight - currMenuItem.borderwidth;
		}

//		if (top + currMenuItem.subMenu.height > pageBottom) {
//			top -= currMenuItem.subMenu.height - objHeight + 8; 
//		}
		z_index = objZIndex + 1;
	
		currMenuItem.subMenu.expand(left, top, z_index);
		currMenuItem.subMenu.show();
		currMenu.openSubMenu = currMenuItem.subMenu;
		
	}
}


/*----------------------------------------------------
// menuItem_mouseout
//----------------------------------------------------
// Event handler for menuItem mouseouts.
// Uses global variable holdtime.
//--------------------------------------------------*/

function menuItem_mouseout() {
	// Begin timer to collapse all menus.
	
	timer = setTimeout("collapseRootMenu();", holdtime);
}


/*----------------------------------------------------
// menu Object and Related Functions
//--------------------------------------------------*/

/*----------------------------------------------------
// menu
//----------------------------------------------------
// Constructor for menu
//
// Pass in handles to each of its menuItems.
//--------------------------------------------------*/

function menu() {

	//--------------------------------------------------------------------------------
	// Assign each menuItem argument individually.
	// Normally, we would just assign the whole array to menuItems.
	//
	// e.g.		this.menuItems = menu.arguments
	//
	// However, Netscape Communicator 4.05 has a bug that messes up the assignment.
	//--------------------------------------------------------------------------------

	this.menuItems = new Array();
	for (var i = 0; i < menu.arguments.length; i++) {
		this.menuItems[i] = menu.arguments[i];
		menu.arguments[i].menu = this;
	}

	this.width = 0;					// Overall width of menu.
	this.height = 0;				// Overall height of menu.
	this.direction = "right";		// Initially, all menus should go to the right.
	this.openSubMenu = null;		// Handle to any open subMenus.
	this.activeMenuItem = null;		// Handle to menuItem under cursor.
	this.show = menu_show;			// Method to display the menu.
	this.hide = menu_hide;			// Method to hide the menu.
	this.expand = menu_expand;		// Method to place menu at a specific position.
	
	// Method for calculating dimensions of menu.  Normally, we would do this in the menu's
	// constructor (i.e. this routine).  However, IE4 doesn't expose the offsetWidth and
	// offsetHeight properties immediately.  So we'll calculate the dimensions when we first need
	// them.
	this.calculateDimensions = menu_calculateDimensions;
	
	// Method for setting the activeMenuItem.
	this.setActiveMenuItem = menu_setActiveMenuItem;

	return this;
}


/*----------------------------------------------------
// menu_calculateDimensions
//----------------------------------------------------
// Calculates the overall width and height of the menu.
// These dimensions are used to prevent the menu from 
// running off of the page.
//--------------------------------------------------*/

function menu_calculateDimensions() {
	var menuItemWidth = 0;
	var menuItemHeight = 0;
	
	for (var i = 0; i < this.menuItems.length; i++) {
		var borderwidth = this.menuItems[i].borderwidth;
		var obj = this.menuItems[i].obj;
		if (isIE) {
			menuItemWidth = obj.offsetWidth;
			menuItemHeight = obj.offsetHeight - borderwidth;
		} else if (isNav) {
			if (isNN6)
				{
				var obj = document.getElementById(''.concat(this.menuItems[i].id));
				menuItemWidth = obj.offsetWidth;
				menuItemHeight = obj.offsetHeight - borderwidth;
//				menuItemWidth = document.defaultView.getComputedStyle(obj, "").getPropertyValue("width");
//				menuItemHeight = document.defaultView.getComputedStyle(obj, "").getPropertyValue("height") - borderwidth;
				}
			else
				{
				menuItemWidth = obj.clip.width;
				menuItemHeight = obj.clip.height - borderwidth;
				}
		}
		this.width = menuItemWidth > this.width ? menuItemWidth : this.width;
		this.height += menuItemHeight;
	}
	
	// Netscape wraps its text but IE stretches it out.
	// So we're gonna resize the IE menusItems.
	if (isIE) {
		for (var i = 0; i < this.menuItems.length; i++) {
			this.menuItems[i].obj.style.width = this.width;
		}	
	}
}


/*----------------------------------------------------
// menu_setActiveMenuItem
//----------------------------------------------------
// Sets the activeMenuItem for a menu.
// Adjusts menuItem background colors accordingly.
//--------------------------------------------------*/

function menu_setActiveMenuItem(menuItem) {
	// Unhighlight previous activeMenuItem.
	if (this.activeMenuItem) {
		var obj = this.activeMenuItem.obj;
		var bgcolor = this.activeMenuItem.bgcolor;
		
		if (isIE) {
			obj.style.backgroundColor = bgcolor;
		} else if (isNav) {
			if(isNN6)
				{
				var obj= document.getElementById(''.concat(this.activeMenuItem.id));
				obj.style.backgroundColor = bgcolor;
				}
			else
				{
				obj.bgColor = bgcolor;
				}
		}
		this.activeMenuItem = null;
	}
	
	// Highlight new activeMenuItem if one is provided.
	if (menuItem) {
		var obj = menuItem.obj;
		var highlightcolor = menuItem.highlightcolor
		
		if (isIE) {
			obj.style.backgroundColor = highlightcolor;
		} else if (isNav) {
			if(isNN6)
				{
				var obj= document.getElementById(''.concat(menuItem.id));
				obj.style.backgroundColor = highlightcolor;
				}
			else
				{
				obj.bgColor = highlightcolor;
				}
		}
		this.activeMenuItem = menuItem;
	}
}


/*----------------------------------------------------
// menu_expand
//----------------------------------------------------
// Expand method for menus.
// Positions each menuItem separately.
// Pass in left, top and z-index coordinates.
//--------------------------------------------------*/

function menu_expand(left, top, z_index) {
	if (this.width <= 0 || this.height <= 0) {
		this.calculateDimensions();
	}

	// Place each menuItem independently.
	for (var i = 0; i < this.menuItems.length; i++) {
		var obj = this.menuItems[i].obj;
		var borderwidth = this.menuItems[i].borderwidth
		
		if (isIE) {
			obj.style.zIndex = z_index;
			obj.style.pixelLeft = left;
			obj.style.pixelTop = top;

			top += obj.offsetHeight - borderwidth;

		} else if (isNav) {
			if(isNN6)
				{
				var obj = document.getElementById(''.concat(this.menuItems[i].id));
				obj.style.zIndex = z_index;
				obj.style.left = left;
				obj.style.top = top;

				top += obj.offsetHeight - borderwidth;
				}
			else
				{
				obj.zIndex = z_index;
				obj.moveTo(left, top);
	
				top += obj.clip.height - borderwidth;
				}
		}
	}
}


/*----------------------------------------------------
// menu_show
//----------------------------------------------------
// Show method for menus.
// Changes visibility of each menuItem's object.
//--------------------------------------------------*/

function menu_show() {
	for (var i = 0; i < this.menuItems.length; i++) {
		var obj = this.menuItems[i].obj;
		if (isIE) {
			obj.style.visibility = "visible";
		} else if (isNav) {
			if (isNN6)
				{
				var obj = document.getElementById(''.concat(this.menuItems[i].id));
				obj.style.visibility = "visible";
				}
			else
				{
				obj.visibility = "visible";
				}
		}
	}
}


/*----------------------------------------------------
// menu_hide
//----------------------------------------------------
// Hide method for menus.
// Changes visibility of each menuItem's object.
//--------------------------------------------------*/

function menu_hide() {
	// Close any open submenus first.
	if (this.openSubMenu) {
		this.openSubMenu.hide();
		this.openSubMenu = null;
	}

	// Clear activeMenuItem
	this.setActiveMenuItem(null);
	
	// Reset direction to right
	this.direction = "right";

	for (var i = 0; i < this.menuItems.length; i++) {
		var obj = this.menuItems[i].obj;
		if (isIE) {
			obj.style.visibility = "hidden";
		} else if (isNav) {
			if (isNN6)
				{
				var obj = document.getElementById(''.concat(this.menuItems[i].id));
				obj.style.visibility = "hidden";
				}
			else
				{
				obj.visibility = "hidden";
				}
		}
	}
}

function Show(Name,MenuName)

{

	var MItem=document.getElementById('IDM_'.concat(Name));
	

	var width;

	

	if(isIE){

		width= MItem.offsetWidth;
		width= 130;

	}else if(isNav)

		{

		if(isNN6)

			{

			width= 130;//Padocument.defaultView.getComputedStyle(MItem, "").getPropertyValue("width");

			}

		else

			{

			width= 130;

			}

		}

	openRootMenu(MenuName, getIExko(MItem)+width+1, getIEyko(MItem)-23, 0, Name);

//	var MItem=document.getElementById('IDM_'.concat(Name));

//	if (MItem.innerHTML=='')

//		{

//		MItem.innerHTML = MItem.abbr;

//		MItem.abbr = '';

//		if(MenuOpen!='') Hide(MenuOpen);

//		MenuOpen= Name;

//		}

}



function Hide(Name)

{

	var MItem=document.getElementById('IDM_'.concat(Name));

	if (MItem.innerHTML!='')

		{

		MItem.abbr = MItem.innerHTML;

		MItem.innerHTML = '';

		}

}


function getIExko ( obj ) {

  if ( obj == document.body ) return obj.offsetLeft

  else return obj.offsetLeft +getIExko( obj.offsetParent );

}; //end getIExKo ( object ) -> int



function getIEyko ( obj ) {

  if ( obj == document.body ) return obj.offsetTop

  else return obj.offsetTop +getIEyko( obj.offsetParent );

}; //end getIEyko 

function showStatus( f){}

function goCategory(strCategory,opennew) {

		if(opennew == 1) {

			window.open(strCategory, '_new', '');

		}

		else {

			window.location = strCategory;

			window.status=strCategory;

		}

	}


// param_paul.js
/*----------------------------------------------------
// Browser Detect
//--------------------------------------------------*/

var isNav, isIE;
if (parseInt(navigator.appVersion) >= 4) {
	if (navigator.appName == "Netscape") {
		isNav = true;
	} else {
		isIE = true;
	}
}

/*----------------------------------------------------
// Buy Button menuItemProp
//--------------------------------------------------*/

var msi_corp_website_style = new Array();

msi_corp_website_style["width"] = "170px";
msi_corp_website_style["z-index"] = "100";
msi_corp_website_style["height"] = "15px";
msi_corp_website_style["color"] = "#efeeed";
msi_corp_website_style["font-size"] = "11px";
msi_corp_website_style["font-size"] = "11px";
msi_corp_website_style["text-align"] = "left";
msi_corp_website_style["font-style"] = "normal";	//bold
msi_corp_website_style["font-family"] = "Arial"; //if assign multiple fonts, it causes error!!
msi_corp_website_style["border-width"] = "1px";
msi_corp_website_style["border-color"] = "#FFFFFF";
msi_corp_website_style["border-style"] = "solid";
msi_corp_website_style["line-height"] = "normal";
msi_corp_website_style["cursor"] = "pointer";
msi_corp_website_style["text-decoration"]="none";
if (isIE) {
	msi_corp_website_style['padding'] = 4;
} else if (isNav) {
	msi_corp_website_style['padding'] = 4;
}

var ltcategorybuttonstyle = new Array();

ltcategorybuttonstyle["width"] = 150;
ltcategorybuttonstyle["color"] = "#005826";
ltcategorybuttonstyle["font-size"] = "12px";
ltcategorybuttonstyle["font-weight"] = "bold";
ltcategorybuttonstyle["font-style"] = "bold";
ltcategorybuttonstyle["font-family"] = "arial";
ltcategorybuttonstyle["border-width"] = 1;
ltcategorybuttonstyle["border-color"] = "#ffffff";
ltcategorybuttonstyle["border-style"] = "solid";
ltcategorybuttonstyle["line-height"] = "normal";
ltcategorybuttonstyle["cursor"] = "pointer";
if (isIE) {
	ltcategorybuttonstyle['padding'] = 0;
} else if (isNav) {
	ltcategorybuttonstyle['padding'] = 0;
}

var buybuttonstyle = new Array();

buybuttonstyle["width"] = "100";
buybuttonstyle["color"] = "#000000";
buybuttonstyle["font-size"] = "10px";
buybuttonstyle["font-weight"] = "normal";
buybuttonstyle["font-style"] = "normal";
buybuttonstyle["font-family"] = "sans-serif";
buybuttonstyle["border-width"] = "1px";
buybuttonstyle["border-color"] = "#000000";
buybuttonstyle["border-style"] = "none";
buybuttonstyle["line-height"] = "normal";
buybuttonstyle["cursor"] = "pointer";
if (isIE) {
	buybuttonstyle['padding'] = 0;
} else if (isNav) {
	buybuttonstyle['padding'] = 0;
}

var msi_corp_website_prop = new menuItemProp(
	170,									// width
	"#91aa37",								// bgcolor
	"#4E5B1E",								// highlightcolor
	1,										// borderwidth
	"",				// imagesrc
	9,										// imagewidth
	msi_corp_website_style
);



// dungpt function
function CreateBookmarkLink() {

 title = "EVA - Thế giới của phái đẹp Việt Nam"; 
 url = "http://www.eva.vn";


	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
 }

function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function j_substr( str, len) {
	
	if( str.length<=len) {
		document.write( str);
		return true;
	}
	var str2 = str.substring(0, str.substring(0, len).lastIndexOf(" "));
	document.write( str2 + '...');
}









