//////////////////////////////////////////////////////////////////////////////////////////////////////////
function getBrowseVersion()
{
	var Sys = {};
    var ua = navigator.userAgent.toLowerCase();
    var s;
    (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
    (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
    (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
    (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
    (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;

    //以下进行测试
	if(Sys.ie)return 'IE:'+Sys.ie; 
	if(Sys.firefox)return "FireFox"; //('Firefox: '+Sys.firefox);
	if(Sys.chrome)return "Chrome";//('Chrome: '+Sys.chrome);
	if(Sys.opera)return "Opera";//('Opera: '+Sys.opera);
	if(Sys.safari)return "Safari";//('Safari: '+Sys.safari);	
}

//取消回车对所有按扭的提交=========================================*/
function FormKeyDown(){ 
    if(event.keyCode==13) {       
        return false;
    }
}
document.getElementById("form1").onkeydown=FormKeyDown;
document.getElementById("form1").autocomplete="off";//取消文本框历史
//取消回车对所有按扭的提交=========================================*/

//当某个文本框按下回车时,指当click某个按扭
function doButton(btID){   
    if(event.keyCode==13) {
        //btID指对应的提交按扭的id名称
        var bt=document.getElementById(btID);
        bt.focus();
        bt.click();
    }
}


/*firefox 处理event对像=========================================*/
function __firefox(){
    HTMLElement.prototype.__defineGetter__("runtimeStyle", __element_style);
    window.constructor.prototype.__defineGetter__("event", __window_event);
    Event.prototype.__defineGetter__("srcElement", __event_srcElement);
}
function __element_style(){
    return this.style;
}
function __window_event(){
    return __window_event_constructor();
}
function __event_srcElement(){
    return this.target;
}
function __window_event_constructor(){
    if(document.all){
        return window.event;
    }
    var _caller = __window_event_constructor.caller;
    while(_caller!=null){
        var _argument = _caller.arguments[0];
        if(_argument){
            var _temp = _argument.constructor;
            if(_temp.toString().indexOf("Event")!=-1){
                return _argument;
            }
        }
        _caller = _caller.caller;
    }
    return null;
}
if(window.addEventListener){
    __firefox();
}
/*end firefox 处理event对像=========================================*/


function opwCar(){
 	var w=(window.screen.width-780)/2;
	var h=(window.screen.height-600)/2;
	var	url="../order/AddToCar.aspx";
	window.open(url,'OrderCenter',"fullscreen=no,channelmode=no,toolbar=mp,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=780,top="+h+",height=530,left="+w);
}

function TalkNow2(msn){
    window.open("msnim:chat?contact="+msn);
}

function openWindow(url,title,style){
	if (style=="" || style==null){
		style="fullscreen=no," 		//yes/no/1/0  是否全屏，默认no
		style+="channelmode=no,"	//yes/no/1/0  是否显示频道栏，默认no
		style+="toolbar=no,"		//yes/no/1/0  是否显示工具条，默认no
		style+="location=no,"		//yes/no/1/0  是否显示地址栏，默认no
		style+="directories=no,"	//yes/no/1/0  是否显示转向按钮，默认no
		style+="status=no,"		//yes/no/1/0  是否显示窗口状态条，默认no
		style+="menubar=no,"		//yes/no/1/0  是否显示频道栏，默认no
		style+="scrollbars=yes,"	//yes/no/1/0  是否显示滚动条，默认yes
		style+="resizable=no,"		//yes/no/1/0  是否窗口可调整大小，默认no
		style+="width=10,"		//yes/no/1/0  窗口宽度（像素单位）
		style+="height=10,"		//yes/no/1/0  窗口高度（像素单位）
		style+="top=0,"			//yes/no/1/0  窗口离屏幕顶部距离（像素单位）
		style+="left=0,"		//yes/no/1/0  窗口离屏幕左边距离（像素单位）
	}
	if (title=="" || title==null){
	    title="无标题";
	}
	window.open(url,title,style);
}

