﻿// JScript 噀鯪



  

/*

9e 恮indow.open齉pe,軴翄@b	g梲鉙E\-N9_鶴,v^c歔鶹歔剉郠蛓梲鉙'Y\.錘邁N鹼邁-N剉蚫\O螛<h.



url        --   9_鶴梲鉙飴刜

sTiltle    --  梲鉙h槝

sSize     --  梲鉙媁鱏,颯錘陙馷峇瀀燫

*/



var nwin;      

function openwindow(url,sTitle,sSize)      

{      

    if (url==''){

      return false;

    }



    if (nwin && !nwin.closed){      

       nwin.close();      

    }      

  



    if (sSize == undefined) {

       alert("鲖c歔梲鉙媁鱏!");

       return false;

    }

    else if (sSize == 100) {

       sWidth  = screen.availWidth;

       sHeight = screen.availHeight;

    }



   else if (sSize == 1) {

       sWidth  = 280;

       sHeight = 120;

    }

    else if (sSize == 2) {

       sWidth  = 600;

       sHeight = 400;

    }



    var l = ( screen.availWidth - sWidth ) / 2;

    var  t = ( screen.availHeight - sHeight ) / 2;      



     

    nwin = window.open(url+"?type=123",sTitle,'left=' + l +',top=' + t 

+',width='+sWidth+',height='+sHeight+',scrollbars=yes,resizable=yes');      

    nwin.focus();    

}

String.prototype.Trim = function(){

		return this.replace(/(^\s*)|(\s*$)/g,"");

	}

	function checkform(form){

		function checktrim(obj,msg){

			if (obj.value.Trim().length < 1){

				obj.style.backgroundColor = "#fcf";

				alert(msg);

				obj.focus();

				return false;

			}else{

				obj.style.backgroundColor = "";

				return true;

			}

		}

		return (

			checktrim(form.cxusername,"鲖搹eQOXT^鱏")

			&&

			checktrim(form.cxpassword,"鲖搹eQN*N髞\6MOpe剉芠x")

		);

	}

	function checkBrowserVersion()

			{

				//纇Km/f&T/fIE

				if(window.navigator.userAgent.indexOf("MSIE")>-1)

				{

					//纇KmIEHr,g/f&T/f5.0b5.0錘
N

					

						return true;

					

				}

				//纇KmFirefoxHr,g鱏

				else if(parseFloat(window.navigator.appVersion)>=3.0)

				{

					//颯錘O(uMozilla 3.0Om葔hVHr,g烺齹

					return false;

				}

			}

function closeWindow()

{



jQuery(".AlertLogo").removeClass("touming").prependTo(jQuery(document.body)).hide();

if(document.getElementById('back')!=null)

{

document.getElementById('back').parentNode.removeChild(document.getElementById('back'));

}

if(document.getElementById('loginWindow')!=null)

{

document.getElementById('loginWindow').parentNode.removeChild(document.getElementById('loginWindow'));

}





}



function createLogin(parameter,title)

{

closeWindow();

alert("hah");

var bWidth=parseInt(document.documentElement.scrollWidth);

var bHeight=parseInt(document.documentElement.scrollHeight);

var dWidth=bWidth/3;

var dHeight=document.documentElement.scrollTop+100;

var back=document.createElement("div");

back.id="back";

var styleStr="top:0px;left:0px;position:absolute;background:#000000;width:"+bWidth+"px;height:"+bHeight+"px;";

if(checkBrowserVersion())

{

    styleStr+="filter:alpha(opacity=50,FinishOpacity=100);";

}

else

{

    styleStr+="opacity:0.5";

}





back.style.cssText=styleStr;

document.body.appendChild(back);



var mesW=document.createElement("div");

mesW.id="loginWindow";

mesW.className="loginWindow";

mesW.innerHTML="<div class='alert_out' ><div class='alert_title' ><span style=' float:left;  text-align:right; padding-right:80px; width:240px'>"+title+"</span><span style='float:right; cursor:pointer; width:80px' onclick='closeWindow()'>[sQ頃]</span></div><div class='alert_content' >"+parameter+"</div><div class='alert_title'><a  onclick='closeWindow()'>nx歔</a></div><iframe src='javascript:false' style='position:absolute; visibility:inherit; top:0px; left:0px; width:100%; height:100%; z-index:-1; filter=\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\";'></iframe></div>";

var styleStr=" left:"+dWidth+"px;top:"+dHeight+"px;position:absolute;";

mesW.style.cssText=styleStr;

document.body.appendChild(mesW); 



}

function TagMenu(obj,obj1,objitem,objitemH,Tag)

		{

			jQuery(obj).find("."+objitem).hover(function(){

				  var mindex=jQuery(obj).find("."+objitem).index(jQuery(this));

				  jQuery(this).addClass(objitemH).siblings("."+objitem).removeClass(objitemH);

				  jQuery(obj1).find(Tag).eq(mindex).show().siblings(Tag).hide()

			 });

		}

		



function createLogin(parameter,title)

{

closeWindow();



var bWidth=parseInt(document.documentElement.scrollWidth);

var bHeight=parseInt(document.documentElement.scrollHeight);

var dWidth=bWidth/3;

var dHeight=document.documentElement.scrollTop+150;

var back=document.createElement("div");

back.id="back";

var styleStr="top:0px;left:0px;position:absolute;z-index:9999;background:#000000;width:"+bWidth+"px;height:"+bHeight+"px;";

if(checkBrowserVersion())

{

    styleStr+="filter:alpha(opacity=50,FinishOpacity=100);";

}

else

{

    styleStr+="opacity:0.5";

}





back.style.cssText=styleStr;

document.body.appendChild(back);



var mesW=document.createElement("div");

mesW.id="loginWindow";

mesW.className="loginWindow";

mesW.innerHTML="";

jQuery(".AlertLogo").prependTo(jQuery(mesW));



var styleStr=" left:"+dWidth+"px;top:"+dHeight+"px;position:absolute; z-index:10000;";

mesW.style.cssText=styleStr;

document.body.appendChild(mesW); 

jQuery(mesW).find(".AlertLogo").show().addClass("touming");



}

function onLand(){

	document.location.href="userreg.asp";

}



function GetCartNum(obj1,obj2)

{

	jQuery.getJSON("/Server/CartMess.asp",

	{ "Type": "jiaqianshu", "Date": new Date().getTime().toString(36) },

	function(data) { 

		var zevalu = data.ze;

		jQuery(obj1).html(zevalu);

		jQuery(obj2).html(data.cont);

	});

}





function pageShow(){



		jQuery(window.top.document).find("html,body").animate({ scrollTop: 0 }, 600);

}
