function MenuItemOver(objLink){
	var arrImage = objLink.getElementsByTagName("img");
	if ( arrImage != null && arrImage != 'undefined' && arrImage.length == 1 ){
		objImage = arrImage[0];
		imgSrc = objImage.src;
		objImage.src = imgSrc.substring(0, imgSrc.length - 7) + "on.jpg";	
	}
}

function MenuItemOut(objLink){
	var arrImage = objLink.getElementsByTagName("img");
	if ( arrImage != null && arrImage != 'undefined' && arrImage.length == 1 ){
		objImage = arrImage[0];
		imgSrc = objImage.src;
		objImage.src = imgSrc.substring(0, imgSrc.length - 6) + "off.jpg";	
	}
}

function PreviewImage(sURL) {
	popup(sURL, 'PreviewImage', '', '', 50, 50, "yes", "yes", "yes");
}

function popup(url, wname, wid, hei, lft, tp, hasScroll, hasMenu, isResizable){
	param = "toolbar=no,menubar=" + hasMenu + ",scrollbars="+hasScroll+",resizable=" + isResizable + ",status=no,location=no";
	
	var newWindow;
	
	if ( document.layers ){
		if ( wid != '' && hei != '' )
			newWindow = window.open(url, wname, param + ',height='+hei+',width='+wid+',screenX='+lft+',screenY='+tp);
		else
			newWindow = window.open(url, wname, param + ',screenX='+lft+',screenY='+tp);
	}else{
		if ( wid != '' && hei != '' )
			newWindow = window.open(url, wname, param + ',height='+hei+',width='+wid+',left='+lft+',top='+tp);
		else
			newWindow = window.open(url, wname, param + ',left='+lft+',top='+tp);
	}
	
	newWindow.focus();
}

function BookmarkPage(url, description)
{
	var agt=navigator.userAgent.toLowerCase();

	var msgNetscape = "Hit CTRL+D to add a bookmark to this site."
	var msgFFMac = "Hit Command key+D to add a bookmark to this site."
	var msgSafariMac = "Hit Command key+D to add a bookmark to this site."
	
	var is_mac = (agt.indexOf("mac")!=-1);
	var is_safari = (agt.indexOf('safari') != -1);
	var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	var is_netscape = ( navigator.appName=='Netscape' )
	
	if ( is_mac ){
		if ( is_safari ){
			alert(msgSafariMac)
		}else{
			alert(msgFFMac)
		}
	}else{
		if ( is_ie )
		{
			window.external.AddFavorite(url, description);
		}
		else if ( is_netscape )
		{
			alert(msgNetscape);
		}	
	}
}

function InitPagingScript(nPageNum){
	var hdnSearch = document.getElementById('hdnIsSearchClicked');
	if ( hdnSearch != null && hdnSearch != 'undefined' )
		hdnSearch.value='false';
	document.getElementById('hdnPageNum').value=nPageNum;
}

function ShowClientCatGenre(){
	var agt=navigator.userAgent.toLowerCase();
	var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	
	var rbMQC = document.getElementById('rbMQC')
	var rbRR = document.getElementById('rbRR')
	
	var tbCat = document.getElementById('tbCat')
	var tbGenre = document.getElementById('tbGenre')

	tbCat.style.display='none';
	tbCat.style.visibility='hidden';
	tbGenre.style.display='none';
	tbGenre.style.visibility='hidden';		

	if ( rbMQC.checked == true || rbRR.checked == true ){

		if ( rbMQC.checked == true ){
				if ( is_ie )
					tbCat.style.display = 'block';
				else
					tbCat.style.display = 'table-row-group';
			tbCat.style.visibility='visible';
		}else{
			if ( is_ie )
				tbGenre.style.display = 'block';
			else	
				tbGenre.style.display = 'table-row-group';
			tbGenre.style.visibility='visible';
		}
	}
}

function CheckKey(){		
	if (window.event.keyCode == 13){
		var hdnIsSearchCl = document.getElementById('hdnIsSearchClicked')
		if ( hdnIsSearchCl != 'undefined' && hdnIsSearchCl != null )
			document.getElementById('hdnIsSearchClicked').value = 'true';

		if (document.forms.length > 0){
			var frm = document.forms[0];
			frm.submit();
		}
	}
}

function ShowState(){	
	var agt=navigator.userAgent.toLowerCase();
	var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	
	var ddlCountry = document.getElementById('ddlCountry')
	var selectedCountry = ddlCountry.options[ddlCountry.selectedIndex].value
	var tbState = document.getElementById('tbState')
	var txtUnitedStates = 'United States'
	
	tbState.style.visibility='visible';
	tbState.style.display='none';
	tbState.style.visibility='hidden';	
	
	
	tbState.style.visibility='visible';

	if ( selectedCountry == txtUnitedStates ){
			if ( is_ie )
				tbState.style.display = 'block';
			else{
				tbState.style.display = 'table-row-group';
			}
			tbState.style.visibility='visible';	
	}
}
