﻿function TnGotoProduct(v){
	document.location = '/shopping/category_prd.asp?itemid='+v;
}

//酒捞厄家 惑前 其捞瘤 捞悼
function TnGotoItsProduct(v){
		TnGotoProduct(v);
	}
	
function GoToBrandShop(designerid){
	if (designerid == ""){
		alert("胶飘府飘 宏坊靛啊 绝嚼聪促.")
	}
	//location.href = "/street/brandshop.asp?designerid=" + designerid;
	location.href = "/street/street_brand.asp?makerid=" + designerid;
}


function GetByteLength(val){
 	var real_byte = val.length;
 	for (var ii=0; ii<val.length; ii++) {
  		var temp = val.substr(ii,1).charCodeAt(0);
  		if (temp > 127) { real_byte++; }
 	}

   return real_byte;
}


//function TnAddShoppingBag(bool){
//	var opt="";

//	for (var i=0;i<sbagfrm.elements.length;i++){
//		//check optioon
//		var e = sbagfrm.elements[i];

//		if (e.type=="select-one"){

//			if (e.value == ""){
//				alert("可记阑 急琶窍技夸..");
//				return;
//			}else if (e[e.selectedIndex].id == "S") {
//				alert("前例等 可记篮 备概窍角 荐 绝嚼聪促.");
//				return;
//			}else{
//				opt = e.value ;
//			}
//		}
//		//check itemEA
//		if ((e.type=="text")&&(e.name=="itemea")){
//			for (var j=0; j < e.value.length; j++){
//				if (((e.value.charAt(j) * 0 == 0) == false)||(e.value==0)){
//					alert('荐樊篮 箭磊父 啊瓷钦聪促..');
//					e.focus();
//					return;
//				}
//			}
//		}
//	}

//	if (sbagfrm.requiredetail!=undefined){
//		if (sbagfrm.requiredetail.value==requiredetailDefault){
//			sbagfrm.requiredetail.value = "";
//		}

//		if (sbagfrm.requiredetail.value.length<1){
//			alert('林巩 力累 惑前 巩备甫 累己秦 林技夸.');
//			sbagfrm.requiredetail.focus();
//			return;
//		}

//		if(GetByteLength(sbagfrm.requiredetail.value)>255){
//			alert('巩备 涝仿篮 茄臂 弥措 120磊 鳖瘤 啊瓷钦聪促.');
//			sbagfrm.requiredetail.focus();
//			return;
//		}
//	}

//	if (opt=='') opt="0000";
//	   document.sbagfrm.itemoption.value = opt;

//    if (bool==true){
//        //var addparams = "?mode=add&itemid=" + document.sbagfrm.itemid.value + "&itemoption=" + document.sbagfrm.itemoption.value + "&itemea=" + document.sbagfrm.itemea.value;
//      //var BagWin = window.open('/inipay/addshoppingbag_process.asp' + addparams ,'BagWin','width=500,height=300,scrollbars=no,resizable=no');
//        //BagWin.focus();

//       document.sbagfrm.action = "/inipay/addshoppingbag_process.asp";
//        var BagWin = window.open('','iiBagWin','width=380,height=180,scrollbars=no,resizable=no');
//        BagWin.focus();
        
//        document.sbagfrm.target = "iiBagWin";
//       
//        document.sbagfrm.submit();

//    }else{
//        document.sbagfrm.target = "_self";
//    	document.sbagfrm.action="/inipay/shoppingbag.asp";
//   	document.sbagfrm.submit();
//    }
//}

function TnAddShoppingBag(bool){
    var frm = document.sbagfrm;
    var optCode = "0000";
    
    
    if (!frm.item_option){
        //可记 绝绰版快
        
    }else if (!frm.item_option[0].length){
        //窜老 可记
        if (frm.item_option.value.length<1){
            alert('可记阑 急琶 窍技夸.');
            frm.item_option.focus();
            return;
        }
        
        if (frm.item_option.id=="S"){
            alert('前例等 可记篮 备概窍角 荐 绝嚼聪促.');
            frm.item_option.focus();
            return;
        }
        
        optCode = frm.item_option.value;
    }else{
        //捞吝 可记 版快
        
        for (var i=0;i<frm.item_option.length;i++){
            if (frm.item_option[i].value.length<1){
                alert('可记阑 急琶 窍技夸.');
                frm.item_option[i].focus();
                return;
            }
            
            if (frm.item_option[i].options[frm.item_option[i].selectedIndex].id=="S"){
                alert('前例等 可记篮 备概窍角 荐 绝嚼聪促.');
                frm.item_option[i].focus();
                return;
            }
        
            if (i==0){
                optCode = "Z" + frm.item_option[i].value.substr(1,1);
            }else if (i==1){
                optCode = optCode + frm.item_option[i].value.substr(1,1);
            }else if (i==2){
                optCode = optCode + frm.item_option[i].value.substr(1,1);
            }
        }
        
        if (optCode.length==2){
            optCode = optCode + "00";
        }
        
        if (optCode.length==3){
            optCode = optCode + "0";
        }
    }
    
    frm.itemoption.value = optCode;
    
    for (var j=0; j < frm.itemea.value.length; j++){
        if (((frm.itemea.value.charAt(j) * 0 == 0) == false)||(frm.itemea.value==0)){
    		alert('荐樊篮 箭磊父 啊瓷钦聪促.');
    		e.focus();
    		return;
    	}
    }
    
    if (frm.requiredetail){

		if (frm.requiredetail.value.length<1){
			alert('林巩 力累 惑前 巩备甫 累己秦 林技夸.');
			frm.requiredetail.focus();
			return;
		}

		if(GetByteLength(frm.requiredetail.value)>255){
			alert('巩备 涝仿篮 茄臂 弥措 120磊 鳖瘤 啊瓷钦聪促.');
			frm.requiredetail.focus();
			return;
		}
	}
    
    if (bool==true){
        frm.action = "/inipay/addshoppingbag_process.asp";
        var BagWin = window.open('','iiBagWin','width=350,height=250,scrollbars=no,resizable=no');
        BagWin.focus();
        
        frm.target = "iiBagWin";
        frm.submit();

    }else{
        frm.target = "_self";
    	frm.action="/inipay/shoppingbag.asp";
    	frm.submit();
    }
    
}


//捞吝 可记 牢版快 鞘夸
function CheckMultiOption(comp){
    var frm = comp.form;
    var compid = comp.id;
    var compvalue = comp.value;
    var compname  = comp.name;
    
    var optSelObj = eval(frm.name + "." + compname);

    var PreSelObj = null;
    var NextSelObj = null;
    var ReDrawObj = null;
    
    if (!optSelObj.length){
        return;
    }
    
    if ((compid==0)&&(optSelObj.length>1)) {
        NextSelObj = optSelObj[1];
        if (optSelObj.length>2) {
            ReDrawObj = optSelObj[2];
        }else{
            ReDrawObj = optSelObj[1];
        }
    }
    
    if ((compid==1)&&(optSelObj.length>2)) {
        PreSelObj  = optSelObj[0];
        NextSelObj = optSelObj[2];
        ReDrawObj = optSelObj[2];
    }
    
    if (compid==2) {
        PreSelObj  = optSelObj[1];
    }
    
    if ((PreSelObj!=null)&&(PreSelObj.value.length<1)){
        alert('惑困 可记阑 刚历 急琶 窍技夸.');
        comp.value = '';
        PreSelObj.focus();
        return;
    }
        
    // 弥 窍困父 前例 技泼
    var found = false;
    var issoldout = false;
    
    
    if ( (compvalue.length>0) && (( (ReDrawObj!=null)&&(optSelObj.length-compid==2) )||( (ReDrawObj!=null)&&(optSelObj.length-compid==3)&&(NextSelObj.value.length>0) ))) {
        for (var i=0; i<NextSelObj.length; i++){
            if (NextSelObj.options[i].value.length<1) continue;
            
            found = false;
            issoldout = false;
            for (var j=0;j<Mopt_Code.length;j++){
                // Box2Ea, Select1-Change
                if ((compid==0)&&(optSelObj.length==2)){
                    if (Mopt_Code[j].substr(1,1)==compvalue.substr(1,1)&&(Mopt_Code[j].substr(2,1)==ReDrawObj.options[i].value.substr(1,1))){
                        found = true;
                        ReDrawObj.options[i].style.color= "#000000";
                        break;
                    }
                }
                
                // Box3Ea, Select2-Change
                else if ((compid==1)&&(optSelObj.length==3)) {
                    if ((Mopt_Code[j].substr(1,1)==PreSelObj.value.substr(1,1))&&(Mopt_Code[j].substr(2,1)==comp.value.substr(1,1))&&(Mopt_Code[j].substr(3,1)==ReDrawObj.options[i].value.substr(1,1))){
                        found = true;
                        ReDrawObj.options[i].style.color= "#000000";
                        break;
                    }
                }
                
                // Box3Ea, Select2 Value Exists, Select1-Change
                else if ((compid==0)&&(optSelObj.length==3)&&(NextSelObj.value.length>0)){
                    if ((Mopt_Code[j].substr(1,1)==compvalue.substr(1,1))&&(Mopt_Code[j].substr(2,1)==NextSelObj.value.substr(1,1))&&(Mopt_Code[j].substr(3,1)==ReDrawObj.options[i].value.substr(1,1))){
                        found = true;
                        ReDrawObj.options[i].style.color= "#000000";
                        break;
                    }
                }
            }
            
            
            if (!found){
                ReDrawObj.options[i].text = ReDrawObj.options[i].value.substr(2,255) + " (前例)";
                ReDrawObj.options[i].id = "S";
                ReDrawObj.options[i].style.color= "#DD8888";
            }else{
                if (Mopt_S[j]==true){
                    ReDrawObj.options[i].text = ReDrawObj.options[i].value.substr(2,255) + " (前例)";
                    ReDrawObj.options[i].id = "S";
                    ReDrawObj.options[i].style.color= "#DD8888";
                }else{
                    if ( Mopt_LimitEa[j].length>0){
                        ReDrawObj.options[i].text = ReDrawObj.options[i].value.substr(2,255) + " (茄沥 " + Mopt_LimitEa[j] + " 俺)";
                    }else{
                        ReDrawObj.options[i].text = ReDrawObj.options[i].value.substr(2,255);
                    }
                    ReDrawObj.options[i].style.color= "#000000";
                    ReDrawObj.options[i].id = "";
                }
            }
        }
    }
}


function TnLoginMsg(){
	alert('肺弊牢 饶 荤侩窍技夸.');
}


//肺弊牢 饶 肺弊牢 其捞瘤 扑诀贸府
function jsChklogin(blnLogin){	
	if (blnLogin == "True"){
		return true;
	}	
	if(confirm("肺弊牢 窍矫摆嚼聪鳖?")){			
			var winLogin = window.open('/login/PopLoginPage.asp','popLogin','width=400,height=300');
			winLogin.focus();
	}
	return false;
	
}

// 包缴 前格 淬扁 - 惑前 其捞瘤 傈侩 : 惑前 内靛肺 函版
function TnAddFavorite(iitemid){
	//if (confirm('包缴前格俊 眠啊 窍矫摆嚼聪鳖?')){
		var params = "mode=add&itemid=" + iitemid ;

        var FavWin = window.open('/my10x10/myfavorite_process.asp?' + params ,'FavWin','width=380,height=180,scrollbars=no,resizable=no');
    	FavWin.focus();
	//}
}

// 包缴 前格 淬扁 -- 促荐 急琶 啊瓷
function TnAddFavoriteList(){
	var ArrayFavItemID='';
	var chkbx = document.getElementsByName('chkbxFav');

	for (var i=0;i<chkbx.length;i++) {
			if (chkbx[i].checked){
				ArrayFavItemID=ArrayFavItemID  + ',' + chkbx[i].value;
			}
	}

	if (ArrayFavItemID.length < 1){
			alert('窍唱 捞惑 惑前阑 急琶秦 林技夸');
			return
	}	else	 {
			if (confirm('包缴前格俊 眠啊窍矫摆嚼聪鳖?')){

			var FavWin = window.open('/my10x10/myfavorite_process.asp?mode=AddFavItems&bagarray=' + ArrayFavItemID ,'FavWin','width=500,height=300,scrollbars=no,resizable=no');
			FavWin.focus();
			}

	}

}

function TnMyBrandJJim(frm,makerid){
	if (frm.userid.value.length<1){
		TnLoginMsg();
		return;
	}

	var ret = confirm('急琶 宏罚靛甫 买宏罚靛俊 眠啊 窍矫摆嚼聪鳖?');

	if (ret){
		frm.makerid.value=makerid;
		frm.action = "/street/domybrandjjim.asp";
		frm.submit();
	}
}


function TnSearch(frm){
var re0,re1,v0,v1,tot

  re0=/[a-z]|[0-9]/gi; //康箭磊 菩畔
  re1=/[ぁ-芌]/g; //茄臂菩畔
  v0=frm.rect.value.match(re0); //概摹犬牢
  v1=frm.rect.value.match(re1); //概摹犬牢
  if(v0!=null)v0=v0.length; //官捞飘 备窃
  if(v1!=null)v1=v1.length; //官捞飘 备窃
  tot=v0+(v1*2); //钦阑 备窃

	if (frm.rect.value.length < 1){
		alert('八祸绢甫 涝仿窍技夸..');
		return;
	}

	if (tot < 2){
		alert('1磊 捞惑狼 八祸绢甫 涝仿窍技夸..');
		return;
	}


	frm.submit();
}


function TnGotoEventMain(v){
	if (v==""){
	document.location = '/shoppingtoday/shoppingchance_allevent.asp';
	}else{
	document.location = '/event/eventmain.asp?eventid=' + v;
}
}

function TnGotoEventGroupMain(v,g){
	if (v==""){
		document.location = '/shoppingtoday/shoppingchance_allevent.asp';
	}else{
		document.location = '/event/eventmain.asp?eventid=' + v+'&eGC='+g;
	}
}


function TnFindZip(frmname){
    var popwin = window.open('/lib/searchzip.asp?target=' + frmname, 'findzipcdode', 'width=460,height=250,left=400,top=200,scrollbars=yes,resizable=yes');
    popwin.focus();
}


function PopupNews(v){
    var popwin = window.open('/common/news_popup.asp?idx=' + v,'popupnews', 'width=530,height=800,left=300,top=100,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
    popwin.focus();
}


function PopupBank(){
    var popwin = window.open('/common/online_banking_list.asp','popupbank', 'width=536,height=560,left=400,top=200,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no');
    popwin.focus();
}


function PopupBankDate(v){
    var popwin = window.open('/common/online_banking_list.asp?searchitem=date&searchtext=' + v,'popupbank', 'width=536,height=560,left=400,top=200,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no');
    popwin.focus();
}


function PopupWinner(){
    var popwin = window.open('/common/winner_popup.asp','popupwinner', 'width=536,height=600,left=400,top=200,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no');
    popwin.focus();
}

// 坷橇樲 傍瘤荤亲 惑技焊扁
function popupOffShopNotice(iN,sId){
	var winN;
	winN = window.open("/offshop/board/notice.asp?iN=" + iN+"&sId="+sId ,"popN",'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,width=426,height=600,left=300,top=100');
	winN.focus();
}


function myqnawrite(){
	var popwin;
	popwin = window.open("/cscenter/qna/myqnawrite.asp","myqnawrite","width=700,height=580,scrollbars=yes,resizabled=yes");
	popwin.focus();
}


function IsDigit(v){
	for (var j=0; j < v.length; j++){
		if ((v.charAt(j) * 0 == 0) == false){
			return false;
		}
	}
	return true;
}


function TnLogOut(frm){
	var ret = confirm('肺弊酒眶 窍矫摆嚼聪鳖?');

	if (ret){
		frm.action = '/login/dologout.asp';
		frm.submit();
	}
}


function TnGotoShoppingBag(){
    document.location = '/inipay/shoppingbag.asp';
}


function TnGotoCategoryList(cdl,cdm,cdn){
	if(cdm==""&&cdn=="")
		document.location = '/shopping/category_landing.asp?cdl=' + cdl;
	else
		document.location = '/shopping/category_list.asp?cdl=' + cdl + '&cdm=' + cdm + '&cdn='+cdn;
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}


// Top 皋牢皋春 饭捞绢 On/Off //
	function OnOffTopCate(frm,sw,no)
	{
		var subCate = document.all[frm];
		if(sw=="on") {
			subCate.style.visibility = "visible";
			document.all["tnav"+no].src="http://fiximage.10x10.co.kr/web2008/header/topnav" + no + "on.gif";
		}
		else if(sw=="off") {
			subCate.style.visibility = 'hidden';
			document.all["tnav"+no].src="http://fiximage.10x10.co.kr/web2008/header/topnav" + no + ".gif";
		}
	}

// 皑己盲澄  饭捞绢 On/Off //
	function OnOffTopChannel(frm,sw)
	{
		var subCate = document.all[frm];
		if(sw=="on") {
			subCate.style.visibility = "visible";
		}
		else if(sw=="off") {
			subCate.style.visibility = 'hidden';
		}
	}

// Top My10x10 皋春 饭捞绢 On/Off //
	function OnOffTopMy10x10(sw)
	{
		var topMyMenu = document.all.mytenten;
		if(sw=="on")
			topMyMenu.style.visibility = "visible";
		else
			topMyMenu.style.visibility = 'hidden';
	}

// 敲饭矫 牢海靛 //
function FlashEmbed(fid,fn,wd,ht,para,tranYn)
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + wd + '" height="' + ht + '" id="' + fid + '" align="middle">');
	document.write('<param name="allowScriptAccess" value="always">');
	document.write('<param name="movie" value="' + fn + para + '">');
	document.write('<param name="menu" value="false">');
	document.write('<param name="quality" value="high">');
	if(tranYn=='Y') {
		document.write('<param name="wmode" value="transparent">');}
	document.write('<embed src="' + fn + para + '" menu="false" quality="high" wmode="transparent" width="' + wd + '" height="' + ht + '" name="' + fid + '" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

// 固叼绢敲饭捞绢 牢海靛 //
function WMVEmbed(fid,fn,wd,ht,startYn)
{
	document.write('<object ID="' + fid + '" WIDTH="' + wd + '" HEIGHT="' + ht + '"  classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab standby="Loading Microsoft?Windows? Media Player components..." type="application/x-oleobject">');
	document.write('<param name="Filename" value="' + fn + '">');
	if(startYn=='Y') {
		document.write('<param name="AutoStart" value="true">');}
	else {
		document.write('<param name="AutoStart" value="false">');}
	document.write('<param name="ShowControls" value="true">');
	document.write('<param name="ShowPositionControls" value="false">');
	document.write('<param name="ShowTracker" value="true">');
	document.write('<param name="ShowGotoBar" value="false">');
	document.write('<param name="ShowDisplay" value="false">');
	document.write('<param name="ShowStatusBar" value="true">');
	document.write('<embed type="application/x-mplayer2">');
	document.write('</object>');
}

//惑前 公捞磊 饭捞绢
function ShowInterestFreeImg()
{
	var mx = document.body.scrollLeft + event.clientX;
	var my = document.body.scrollTop + event.clientY;
	document.all.layer_install.style.left=mx;
	document.all.layer_install.style.top=my;
	document.all.layer_install.style.display="";
}

function HideInterestFreeImg(){
	document.all.layer_install.style.display="none";
}

// 惑前饶扁 扑诀
function popEvaluate(iid){
	var subwin;
	subwin = window.open("/common/PopItemEvaluate.asp?itemid=" + iid,"popeval","width=770,height=600,status=no,resizable=no,scrollbars=yes");
	subwin.focus();
}

//惑前饶扁 静扁
function AddEval(OrdSr,itID,OptCd){
	document.location.href='/my10x10/goodsUsingWrite.asp?orderserial=' + OrdSr + '&itemid=' + itID + '&optionCD=' + OptCd ;
}

// 俏芭胶 惑前饶扁 扑诀
function popFingersEvaluate(iid){
	var subwin;
	subwin = window.open("/common/PopFingersItemEvaluate.asp?fingersitemlist=" + iid,"popeval","width=720,height=600,status=no,resizable=yes,scrollbars=yes");
	subwin.focus();
}

// 捞固瘤 惑技焊扁 扑诀
function popShowImg(v){
	  var p = (v);
	  w = window.open("/common/showimage.asp?img=" + v, "imageView", "width=10,height=10,status=no,resizable=yes,scrollbars=yes");
      w.focus();
}


function popShowGiftImg(eCode) {
	var w;
		w =window.open("/event/event_gift_win.asp?eventid=" + eCode ,"eventwin",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=500,height=430');
		w.focus();
	}

// RSS救郴 扑诀
function popRssInfo()
{
	var popwin = window.open('/common/pop_rssGuide.asp','rssGuide','width=360,height=320');
	popwin.focus();
}

//惑前 眠啊 捞固瘤 PopUp
function ZoomItemPop(itemid) {
	var popwin = window.open("/common/PopZoomItem.asp?itemid=" + itemid + '&pop=pop',"win3",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=720,height=444');
    popwin.focus();
}

// 惑前 眠啊 捞固瘤 Layer - 磊技洒 焊扁
function ZoomItem(itemid){

		var wd=document.body.scrollLeft;
		var ht=document.body.scrollTop

		ZoomItemDiv.style.top=ht+50;
		ZoomItemDiv.style.left=wd+50;

		ZoomItemDiv.style.display='';

		initializeURL("/common/AJAX/Category_Addimage_Response.asp?Itemid=" + itemid);
		initializeReturnFunction("onProcessAjax('ZoomItemDiv')");
		initializeErrorFunction("onErrorProcessAjax()");

		startRequest();
}

// 惑前 眠啊 捞固瘤 Layer - 摧扁
function CloseZoomItem(){
	if (document.getElementById('ZoomItemDiv')){
		ZoomItemDiv.innerHTML='';
		ZoomItemDiv.style.display='none';
	} else {
		self.close();
	}

}

// 惑前 眠啊 捞固瘤 Layer - 捞固瘤 函版
var btnT='btnB'; // 急琶等 眠啊捞固瘤 酒捞能
function TnSwitchImageBG(imagesrc,btn){
	document.getElementById("IimageMain").style.backgroundImage = "url('" + imagesrc + "')";

	// 急琶等 捞固瘤绰 #FF0000 弊寇 #B7B7B7

	try {
		document.getElementById(btnT).bgColor='#B7B7B7';
	}	catch(e) {
		document.getElementById('btn0').bgColor='#B7B7B7';
	}

	document.getElementById(btn).bgColor='#FF0000';

	btnT=btn;
}

// 秒家 pop
function popCancel(iorderserial){
    var popwin = window.open('/cscenter/common/popCancelOrder.asp?orderserial=' + iorderserial,'popCancelOrder','width=800,height=600,scrollbars=yes,resizable=yes');
    popwin.focus();
}

// for radio button checked Index
function getCheckedIndex(comp){
    var i =0;
    for( var i = 0 ; i <comp.length;  i++){
        if(comp[i].checked) return i;
    }
    return -1;
}

// 捻迄 罐扁
function DownloadCoupon(itemcouponidx){
	var popwin=window.open('/my10x10/downloaditemcoupon.asp?itemcouponidx=' + itemcouponidx,'DownloadCoupon','width=400,height=400,scrollbars=yes,resizable=yes');
	popwin.focus();
}

// 捞固瘤 荤捞令 府荤捞隆
function Resizeimg(limitwidth,fileid)	{
	var frm = document.getElementById(fileid);
	if (frm.width > limitwidth){
		frm.width=limitwidth;
	}
}

// 皋春 饭捞绢 On/Off 
	function OnOffLeftSubMenu(fnm,sw)
	{
		var leftcate = document.all(fnm);
		if(sw=="on")
			leftcate.style.visibility = "visible";
		else
			leftcate.style.visibility = 'hidden';
	}	

//INPUT怕弊 BOX狼 Value蔼 眉农,CHECKBOX狼 眉农咯何,RADIOBUTTON狼 急琶咯何,SELECT怕弊 BOX狼 急琶咯何 眉农
function jsChkNull(type,obj,msg)
{
 
     switch (type) {
        // text, password, textarea, hidden
        case "text" :
        case "password" :
        case "textarea" :
        case "hidden" :
                if (jsChkBlank(obj.value)) {
					alert(msg);
					//obj.focus();
                    return false;
                }
                else {
                    return true;
                }
                break;
        // checkbox
        case "checkbox" :
                if (!obj.checked) {
					alert(msg);
                    return false;
                }
                else {
                    return true;
                }
                break;
        // radiobutton
        case "radio" :
                var objlen = obj.length;

                for (i=0; i < objlen; i++) {
                    if (obj[i].checked == true)
                        return true;
				}
                if (i == objlen) {
					alert(msg);
                    return false;
                }else{
					return true;
                }
                break;
        }

        // select list
        if (obj.type.indexOf("select") != -1) {
            if (obj.options[obj.selectedIndex].value == 0 || obj.options[obj.selectedIndex].value == ""){
				alert(msg);
                return false;
            }else{
                return true;
			}
        }

        return true;
    
}


//巩磊凯狼 傍归咯何 眉农
function jsChkBlank(str)
{
    if (str == "" || str.split(" ").join("") == ""){
        return true;
	}
    else{
        return false;
	}
}

//敲贰浆 扑诀 焊扁
function TnWinFlash(v,wd,ht){
	var popwin =window.open('/common/watch_flash.asp?movie=' + v+'&wd='+wd+'&ht='+ht, 'findzipcdode', 'width=400,height=340,left=400,top=200,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
    popwin.focus();
}

//悼康惑 扑诀 焊扁 
function TnWinWmv(v,wd,ht){
	var popwin =window.open('/common/watch_wmv.asp?movie=' + v+'&wd='+wd+'&ht='+ht, 'wv', 'width=400,height=340,left=400,top=200,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
    popwin.focus();
}