
function fnPrint() {
	menuID=document.getElementById('vMenu_ID').value
	TakeMeThereNew('index.asp?menuID='+menuID+'&fprint=Y',menuID);
}

function TakeMeThereNew(action, vMenu_ID) {
	var settings = 'toolbar=0,status=1,location=no,menubar=no,directories=no,scrollbars=yes,resizable=yes,top=0,left=0,width=800,height=600';
	var mywin = window.open('blank.htm','subPrintWin', settings);
	this.document.forms[0].vMenu_ID.value = vMenu_ID;
	this.document.forms[0].target = 'subPrintWin';
	this.document.forms[0].method = 'post';
	this.document.forms[0].action = action;
	this.document.forms[0].submit();
}

function getLink(strCtrlName){
	TakeMeIPublish('/index.asp', $(strCtrlName).options[$(strCtrlName).selectedIndex].value);
}



function fnProcessPrint(){
    for (var j=0; j<20; j++) {
	    if (document.getElementById('printhide'+j)) {
		    document.getElementById('printhide'+j).style.display = 'none';
	    }
    }

    var sHTML = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td style="padding-right:3px;background-color:#fffff" width="100%">';
       sHTML += '<p align="right"><a href="javascript:print()"><font color="#ffffff">print</font></a></p></td>';
       sHTML += '<td style="padding-right:3px;background-color:#fffff"><a href="javascript:print()"><img src="/g_images/icon_print.gif" alt="print" ';
       sHTML += 'border="0" align="middle"></a>&nbsp;&nbsp;</td>';
       sHTML += '<td style="padding-right:3px;background-color:#fffff"><input type="button" name="close" value="close window" class="sysbut" onClick="javascript:parent.close();"></td></tr></table><HR/>';

    document.getElementById('fprint_header').innerHTML = sHTML;
    document.getElementById('fprint_header').style.display = '' ;
    document.body.style.background = '#ffffff' ;

    //if (document.getElementById('pfContactUsForm')) document.getElementById('ipfContactUsForm').style.display = 'none';
}

//To display the menu after all the styles are displayed
function DisplayMenus(){
	if ($('dvMenu')){
		$('dvMenu').style.display='';
	}
}


function printMe() {
	if (window.print) {
		window.print();
	} else {
		alert('To print this page, select "File" > "Print" from the main menu of your browser.');
	}
}

function emailMe() {
	Shadowbox.open({
        player:     'iframe',
        title:      'Email article',
        content:    'popupform.asp?form=EmailArticle&title=Email%20Article&multistep=false&mode=form&ref='+ encode(location.href),
        height:     400,
        width:      330
    });
}

function pdfMe() {
}

function contactUs() {
	Shadowbox.open({
        player:     'iframe',
        title:      'Contact Us',
        content:    'popupform.asp?form=contactus&multistep=false&title=Contact%20Us',
        height:     400,
        width:      330
    });
}
function changeImageBackground(elm,imgId)
{
	var orgSrc =  elm.getAttribute("src");
	var ext = orgSrc.substring(orgSrc.lastIndexOf("."),orgSrc.length);
	var newSrc = "";
	 if(orgSrc.lastIndexOf("hover") > 0)
	 {
		newSrc = orgSrc.substring(0,(orgSrc.lastIndexOf("hover")-1))+ ext;
		var imgText = document.getElementById(imgId);
		if(imgText){
			imgText.setAttribute("src","");
			imgText.style.display = "none";
			}
	 }
	 else  if (orgSrc.lastIndexOf(".") > 0)
	 {	
		newSrc = orgSrc.substring(0,orgSrc.lastIndexOf("."))+"_hover"+ ext;
		var txtImg = newSrc.replace("image_","text_");  
		var imgText = document.getElementById(imgId);
		if(imgText){
			imgText.setAttribute("src",txtImg);
			imgText.style.display = "inline";
		}
	 }	 
	elm.setAttribute("src",newSrc);	   
}

Shadowbox.loadSkin('classic', 'js/shadowbox/skin/');
Shadowbox.loadLanguage('en', 'js/shadowbox/');
Shadowbox.loadPlayer(['img', 'html', 'iframe'], 'js/shadowbox/');

Event.observe(window, 'load', function() {
	Shadowbox.init({skipSetup:true});
});
