
<!--hide this script from non-javascript-enabled browsers

var message="Sorry, that function is disabled."; // Message for the alert box
function click(e) {
	if (document.all) {
		if (event.button == 2) {
			alert(message);
			return false;
		}
	}
	if (document.layers) {
		if (e.which == 3) {
		alert(message);
		return false;
		}
	}
}
//if (document.layers) {
//	document.captureEvents(Event.MOUSEDOWN);
//}
//document.onmousedown=click;

function HandleCat(f) {
	//alert ("hello")
	var form =document.forms["frmCtgry"];
	var tFlag;
	for(var i=0;i<form.ctgryI.length;i++)
	{
		if(form.ctgryI[i].selected)
		{
		if (form.ctgryI[i].value =="-1")
		{
		alert("Please select a channel.");
		return false;
		}
		}
	  
	}
	return true
}

function chkSearchStr(f,logF) {

	if ((logF == 0) && (f.selSearch.options[f.selSearch.selectedIndex].value != "C")) {
		open_window("PopupDoc.asp?doctyp=login","login","scrollbars=no,menubar=no,width=300,height=260,resizable=yes");
		return false;
	}
	
	//if (logF == 0) {
	//	open_window("PopupDoc.asp?doctyp=login","login","scrollbars=no,menubar=no,width=300,height=260,resizable=yes");
	//	return false
	//}
	
	if(f.txtSearch.value=="") {
		alert(ErrMsg(240));
		return false;
		} 
			
	if((isNaN(f.txtSearch.value)) && ((f.selSearch.options[f.selSearch.selectedIndex].value == "I") || (f.selSearch.options[f.selSearch.selectedIndex].value == "E"))){
		alert("Please enter a number to search.");
		return false;
		}
	
	if((!(isNaN(f.txtSearch.value))) && ((f.selSearch.options[f.selSearch.selectedIndex].value == "I") || (f.selSearch.options[f.selSearch.selectedIndex].value == "E"))){
		if (parseInt(f.txtSearch.value) > 2147483647) {
			alert("The number you entered is too big.");
			return false;
		}
		if (parseInt(f.txtSearch.value) < 0) {
			alert("Please enter a positive number.");
			return false;
		}
		
		if (f.selSearch.options[f.selSearch.selectedIndex].value == "I") {
		
			if (f.NavBarC1.value == 17) {
				document.frmSortingPgHeading.hidItemStr2.value = f.txtSearch.value + '-H85W128-1,';
				window.open("http://" + document.frmPreviewServer.PreviewServer.value + '/mvMediaPlayer.asp?ItemI=' + f.txtSearch.value + '&ci=1&PItemI=' + f.txtSearch.value + '-H85W128&NItemI=' + f.txtSearch.value + '-H85W128&bi=1&ei=1&rc=1&df=1&pl=1&isCL04F=1','link','scrollbars=yes, status=yes,resizable=yes,width=1000,height=800,top=0,left=0');
				return false;
			}
			else
			{
			f.action="ItemDescription.asp?ItemI=" + f.txtSearch.value;
			f.submit();
			return true;
			}
		}
	}

}
		
function checkInp(f) {
	//alert("window.screen.availWidth: " +  window.screen.availWidth + "\n" + "window.screen.availHeight: " +  window.screen.availHeight);
	document.frmLgn.winWd.value = window.screen.availWidth;
	document.frmLgn.winHt.value = window.screen.availHeight;
	//alert (document.frmLgn.winWd.value + ", " + document.frmLgn.winHt.value)
	/*
	if ((document.frmLgn.UsrN.value == "") || (document.frmLgn.UsrN.length == 0)) 
	{
		alert("Please enter your username.")
		return false;
	} 
	else 
	{
		if ((document.frmLgn.Pwd.value == "") || (document.frmLgn.Pwd.length == 0)) 
		{
			alert("Please enter your password.")
			return false;
		} 
		else 
		{
			return true;
		}
	}
	*/
	return true;
}
		

function open_window(url,name,features){
	popup=window.open(url,name,features);
	if (window.focus)
		popup.focus();
}

function PPWin() {
	PPWind=window.open("","PPWind","resize=no,toolbar=no,scrollbars=yes,width=400,height=300");
}

function UAWin() {
	UAWind=window.open("","UAWind","resize=no,toolbar=no,scrollbars=yes,width=400,height=300");
}
function CAWin() {
	CAWind=window.open("","CAWind","resize=no,toolbar=no,scrollbars=yes,width=400,height=300");
}

//for page select box in Sub SortingPgHeading in SortHeading.asp
function GoToPage(form, CurrPage) {
var selIndex;
	for (x=0; x<form.elements.length; x++) {
		if (form.elements[x].name=="selPage") {	//normally there are 2 select controls called selPage (located Top and Bottom of page)
			selIndex=x;							//if Top control is used it's selected page will be != to CurrPage otherwise it will be = to CurrPage, in which case this loop will not break and will continue on to find the 2nd (bottom) control and use selected value of that control
			if (CurrPage!=form.elements[x].options[form.elements[x].selectedIndex].value) {	
				break;
			}	
		}
	}
	form.action=form.action + "&PageNum=" + form.elements[x].options[form.elements[x].selectedIndex].value;
	form.submit();
}

//For BACK and NEXT
function GoToPageBackNext(form, PageToGoTo) {
	var cImgN;
	var LBImgStr = "";
	var cImgLen;
	var cImgChk;
	var LbImg;
	var cImgI;
	//alert(form.elements.length)

	if(form.elements.length > 0){

		for (x=0; x<form.elements.length; x++) {
			LbImg = form.elements[x];
			cImgN = LbImg.name;
			cImgChk = LbImg.checked;
					
			if ((cImgN.substr(0,6)=="chkImg") && (cImgChk == true)) {	
				cImgLen = cImgN.length;
				cImgI = cImgN.substr(6,cImgLen-6);
				LBImgStr = LBImgStr + cImgI + ",";
				//alert(cImgLen + " " + cImgI + " " + LBImgStr);

			}
			
		}
	//	alert(PageToGoTo);
		
		if (LBImgStr != null){
			form.LBImgStr.value = LBImgStr;
			form.action=form.action + "&PageNum=" + PageToGoTo;
			//form.action=form.action + "&PageNum=" + form.elements[x].options[form.elements[x].selectedIndex].value
			form.submit();
		}	
	}
}

//FOR SelPage
function GoToPageBackNext_DDL(formName,theDDL) {
	var cImgN;
	var LBImgStr = "";
	var cImgLen;
	var cImgChk;
	var LbImg;
	var cImgI;
	var pageToGoTo;

	for (x=0; x < formName.elements.length; x++) {
		LBImg = formName.elements[x];
		cImgN = LBImg.name;
		cImgChk = LBImg.checked;
				
		if ((cImgN.substr(0,6)=="chkImg") && (cImgChk == true)) {	
			cImgLen = cImgN.length;
			cImgI = cImgN.substr(6,cImgLen-6);
			LBImgStr = LBImgStr + cImgI + ",";
		}
		
	}
	pageToGoTo = eval(theDDL.options[theDDL.selectedIndex].value);
	formName.LBImgStr.value = LBImgStr;
	formName.action=formName.action + "&PageNum=" + pageToGoTo;
	//alert(formName.action);
	//form.action=form.action + "&PageNum=" + form.elements[x].options[form.elements[x].selectedIndex].value
	formName.submit();
}


//-->