﻿openBrWindow = function(theURL,winName,features, myWidth, myHeight,isCenter) { //v3.0
	if(window.screen){
		if(isCenter){
			var myLeft = (screen.width-myWidth) / 2;
			var myTop = (screen.height-myHeight) / 2;
			features += (features != '') ? ',':'';
			features += ',left=' + myLeft + ',top=' + myTop;
		}
	}
	winName = window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
	winName.focus();
};
var MenuOut;
var showMenu = 0;
fluctuationMunuBlock = function(obj)
{
    if(showMenu == 1){clearTimeout(MenuOut)}
    for(i = 1 ; i <= 6 ; i++)
    {
        document.getElementById("page_fluctuation_menu_"+ i).style.display = "none";
        
        /*jQuery('#page_fluctuation_menu_' + i).css({
		    display:'none'
	    });*/
    }
    document.getElementById(obj).style.display = "block";
    /*jQuery("#"+obj).css({
	    display:'block'
    });*/
    showMenu = 0;
};

fluctuationMunuNone = function()
{
    MenuOut = setTimeout(function(){
        for(i = 1 ; i <= 6 ; i++)
        {
            document.getElementById("page_fluctuation_menu_" + i).style.display = "none";
            /*jQuery('#page_fluctuation_menu_' + i).css({
		        display:'none'
	        });*/
        }
    },100);
    showMenu = 1;
    
};

printPage = function()
{
    window.print();
}

googleSrarch = function()
{
    var d = "";
    if(getCheckedValue(document.getElementsByName("google_search_box")) == "2"){
        d = "http://www.aewin.com.tw&sitesearch=http://www.aewin.com.tw";
    }
    if($('google_search_txt').value != "")
    {
        Url = "http://www.google.com/custom?q=" + $('google_search_txt').value + "&domains="+ d;
        window.open(Url);
    }
    else
    {
        alert("請輸入搜尋字串");
    }
}
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

/**
* Returns the value of the selected radio button in the radio group, null if
* none are selected, and false if the button group doesn't exist
*
* @param {radio Object} or {radio id} el
* OR
* @param {form Object} or {form id} el
* @param {radio group name} radioGroup
*/
function $RF(el, radioGroup) {
    if($(el).type && $(el).type.toLowerCase() == 'radio') {
        var radioGroup = $(el).name;
        var el = $(el).form;
    } else if ($(el).tagName.toLowerCase() != 'form') {
        return false;
    }

    var checked = $(el).getInputs('radio', radioGroup).find(
        function(re) {return re.checked;}
    );
    return (checked) ? $F(checked) : null;
}