var spawn = null;

//	 Variables

		var w = screen.availWidth;
		var h = screen.availHeight;
		var topP1 = Math.round((h-200)/2);
		var leftP1 = Math.round((w-200)/2);
		var topP2 = Math.round((h-450)/2);
		var leftP2 = Math.round((w-500)/2);
		var topP3 = Math.round((h-410)/2);
		var leftP3 = Math.round((w-400)/2);

//	 ##################################################
//	 Open Popup Window Function
//	 ##################################################
	function winNow(category) {
		spawn = window.open( 'http://pro.jvc.com/prof/qml/asp_qml.asp?tId='+category+'', 'QmlWindow', 'width=637,height=460,screenX='+leftP2+',screenY='+topP2+',top='+topP2+',left='+leftP2+',toolbar=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0' ) ;
	}

	function winCat() {
		spawn = window.open( 'http://pro.jvc.com/prof/qml/asp_qml.asp', 'QmlWindow', 'width=637,height=460,screenX='+leftP2+',screenY='+topP2+',top='+topP2+',left='+leftP2+',toolbar=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0' ) ;
	}


	function winLoadAll(){
    if (spawn != null && !spawn.closed)
    {
         if (spawn.blur) spawn.focus();
    }
    else
    {
	spawn = window.open( '/prof/qml/asp_qml.asp?tId=none', 'QmlWindow', 'width=637,height=460,screenX='+leftP2+',screenY='+topP2+',top='+topP2+',left='+leftP2+',toolbar=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0' ) ;
    }
    
	}

	
	function winLoadAllHome(){
	if(document.search.qt.value.length<=0) 
	{
		alert("Please enter Product to be searched!!!");
		document.search.qt.focus();
	}
	else
	{
		spawn = window.open( '/prof/qml/asp_qml.asp?tId=none&qt=' + document.search.qt.value, 'QmlWindow', 'width=637,height=460,screenX='+leftP2+',screenY='+topP2+',top='+topP2+',left='+leftP2+',toolbar=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0' ) ;
	}	
	}

	function blowOut() {
		if (spawn != null && spawn.open) spawn.close();
	}

    function onTop(category) {
        if (spawn != null && !spawn.closed) {
             if (spawn.blur) spawn.focus();
        } else {
            spawn = window.open( 'http://pro.jvc.com/prof/qml/asp_qml.asp?tId='+category+'', 'QmlWindow', 'width=637,height=460,screenX='+leftP2+',screenY='+topP2+',top='+topP2+',left='+leftP2+',toolbar=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0' ) ;
        }
    }

    function qmlSection(section) {
        spawn = window.open( 'http://pro.jvc.com/prof/qml/asp_qml.asp?tId=none&section='+section+'', 'QmlWindow', 'width=637,height=460,screenX='+leftP2+',screenY='+topP2+',top='+topP2+',left='+leftP2+',toolbar=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0' ) ;
    }

	function changeLanguage(){
		var langValue = "";
		if(document.getElementById("lang") != null)
			langValue = document.getElementById("lang").options[document.getElementById("lang").selectedIndex].value;
		document.search.action="http://pro.jvc.com/prof/main.jsp?lang=" + langValue;
		document.search.submit();
	}

function validat()
{
	if(document.search.search_radio[0].checked)
	{
		if(document.search.qt.value.length>0)
		{
			//document.search.action="http://pro.jvc.com:8765/jpc/query.html";
			document.search.action="http://search.jvc.com/query.html";
			return true;
		}
		else
		{
			alert("Please enter word to be searched!!!");
			document.search.qt.focus();	
			return	false;
		}
	}
	else if(document.search.search_radio[1].checked)
	{
		javascript:winLoadAllHome();
		return false;
		/*}
		else
		{
			alert("Please enter search on one of the three criterias!!!");
			document.search.qt.value="";
			document.search.dl.value="";
			document.search.pd.value="";
			document.search.pd.focus();
			return false;
		}*/		
	}
	else if(document.search.search_radio[2].checked)
	{ 
		window.open("http://pro.peek.jvc.com/prof/dealer_popup_home.jsp","dealer_srch","status=0,height=217,width=249,resizable=no,left=350,top=250,scrollbars=no");
		return false;
	}
}
