﻿/*=====================================================*/
/*通用*/
function isFloat(val){
 var re = /^[\-\+]?([0-9]\d*|0|[1-9]\d{0,2}(,\d{3})*)(\.\d+)?$/;
 if (re.test(val)&&val!=""&&val!=null)
  {
    return true;
  }else{
    return false; 
  } 
}

function isAlphabeticChineseNumber(val){
	var reg = /^[a-zA-Z0-9\u4e00-\u9fa5]+$/;
	if(reg.test(val)&&val!=""&&val!=null){
		return true;
	}else{
		return false; 
	} 
}

/*
* formatMoney(s,type)
* 功能：金额按千位逗号分割
* 参数：s，需要格式化的金额数值.
* 参数：type,判断格式化后的金额是否需要小数位.
* 返回：返回格式化后的数值字符串.
*/
function formatMoney(s,type) {
	if (/[^0-9\.]/.test(s)) return "0";
	if (s == null || s == "") return "0";
	s = s.toString().replace(/^(\d*)$/, "$1.");
	s = (s + "00").replace(/(\d*\.\d\d)\d*/, "$1");
	s = s.replace(".", ",");
	var re = /(\d)(\d{3},)/;
	while (re.test(s))
	s = s.replace(re, "$1,$2");
	s = s.replace(/,(\d\d)$/, ".$1");
	if (type == 0) {// 不带小数位(默认是有小数位)
		var a = s.split(".");
		if (a[1] == "00") {
			s = a[0];
		}
	}
	
	return s;
}

/*======================================================*/

function setMainIframeTitle(i_title){
	window.top.document.getElementById("div_MainIframeTitle").innerHTML=i_title;
}

function setMainIframeHref(i_href){
	window.top.document.getElementById("iframe_MainIframe").contentWindow.location.href=i_href;
}

var blink_step = 0;
function blinkObj(obj_id){
	
	if(document.getElementById(obj_id).style.border==""){
		document.getElementById(obj_id).style.border="3px dashed #FC0";
	}
	else{
		document.getElementById(obj_id).style.border="";
	}
	
	blink_step++;
	
	if(blink_step < 6){
		move = setTimeout("blinkObj('"+obj_id+"')",1000);
	}
	else{
		document.getElementById(obj_id).style.border="";
		window.clearTimeout(move);
		blink_step=0;
	}
}

var timer=null;
var ObjIsFading=false;//很多时候当一个对象在出现和消失时，需要一个标记来判断这个动作没有做完，不要进行下一个动作

function fadeOutObj(i_target,Obj_id){
var f_obj=eval(i_target+".document.getElementById('"+Obj_id+"')");
	
	if(timer){window.clearTimeout(timer);}
	
	if(checkBrowser()=="IE"){
		
		if(f_obj.style.filter ==""){
			f_obj.style.filter ="progid:DXImageTransform.Microsoft.Alpha(opacity=0)";
		}
		
		f_obj.style.display="block";

		if(f_obj.filters.item("DXImageTransform.Microsoft.Alpha").Opacity <100){
			ObjIsFading=true;
			f_obj.filters.item("DXImageTransform.Microsoft.Alpha").Opacity =parseFloat(f_obj.filters.item("DXImageTransform.Microsoft.Alpha").Opacity)+ 5;
			timer=setTimeout("fadeOutObj('"+i_target+"','"+Obj_id+"')",50);
		}
		else{
			f_obj.style.filter ="";
			ObjIsFading=false;
			window.clearTimeout(timer);
		}
		
	}
	else{
		if(f_obj.style.opacity==null||f_obj.style.opacity==""){
			f_obj.style.opacity=0;
			
		}
		
		f_obj.style.display="block";
		
		if(f_obj.style.opacity<1){
			ObjIsFading=true;
			f_obj.style.opacity =parseFloat(f_obj.style.opacity)+ 0.05
			timer=setTimeout("fadeOutObj('"+i_target+"','"+Obj_id+"')",50);
		}
		else{
			f_obj.style.opacity="";
			ObjIsFading=false;
			window.clearTimeout(timer);
		}
	}
}

function ReSizeiFrame(iframe){
	var FFextraHeight = 20;
	if(iframe && !window.opera){
		iframe.style.display = "block";
		if(iframe.contentDocument && iframe.contentDocument.body.offsetHeight){
			iframe.height = iframe.contentDocument.body.offsetHeight + FFextraHeight;
		}
		else if (iframe.Document && iframe.Document.body.scrollHeight){
			iframe.height = iframe.Document.body.scrollHeight + FFextraHeight;
		}
	}
}

function showDivIframe(i_IframeWidth,i_IframeHeight,i_IframeSrc,i_CallerWndObj,i_GoAfterClose,i_Confirm,i_Effect){
//i_CallerWndObj 将与 i_GoAfterClose 配合使用，解决由于showDivIframe是从Top调用而无法准确操作某些内部window的问题
//i_CallerWndObj 是个字符串，就是目标Iframe的名字或者"Top"，i_GoAfterClose是目标地址
//当i_CallerWndObj 为Top 但i_CallerWndObj 为空时那么i_CallerWndObj 刷新
//当i_CallerWndObj 为某个Iframe 的名字或者Id，但i_GoAfterClose 为空时那么那个父页面的Iframe刷新
//其他情况将i_CallerWndObj 指向的window 转向到 i_GoAfterClose的地址
//i_CallerWndObj 和 i_GoAfterClose 使用明文方式传入Div的目标页面
	var confirmResult=false;
	if(i_Confirm!=""){
		if(confirm(i_Confirm)){
			confirmResult=true;
		}
		else{
			return;
		}
	}
	else{
		confirmResult=true;
	}
	
	if(confirmResult){
		var f_IframeSrc=i_IframeSrc;
		if(i_CallerWndObj!=""){
			f_IframeSrc=f_IframeSrc+"&CallerWndObj="+i_CallerWndObj;
		}
		if(i_GoAfterClose!=""){
			f_IframeSrc=f_IframeSrc+"&GoAfterClose="+i_GoAfterClose;
		}
		
		//hide the top.body.scoll or not
		window.top.document.body.style.overflow="hidden";
		
		window.top.document.getElementById("div_OutBlackFrame").style.display="block";
		
		if(checkBrowser()=="IE"){
			window.top.document.getElementById("div_closeIcon").style.top=window.top.document.documentElement.scrollTop+"px";
			window.top.document.getElementById("iframe_InBlackFrame").style.top=window.top.document.documentElement.scrollTop+"px";
		}
		else{
			window.top.document.getElementById("div_closeIcon").style.top=window.top.document.body.scrollTop+"px";
			window.top.document.getElementById("iframe_InBlackFrame").style.top=window.top.document.body.scrollTop+"px";
		}
		
		if(i_Effect==""){
			window.top.document.getElementById("div_InBlackFrame").style.display="block";
		}
			
		if(i_Effect=="fade"){
			fadeOutObj("window.top","div_InBlackFrame");
		}
		
		window.top.document.getElementById("div_closeIcon").style.width=i_IframeWidth+"px";
		window.top.document.getElementById("div_frameLoading").style.width=i_IframeWidth+"px";
		window.top.document.getElementById("div_frameLoading").style.display="block"
		
		var RndStr="";
		if(f_IframeSrc.indexOf("?")>-1){
			RndStr="&rnd="+Math.random()+"";
		}
		else{
			RndStr="?rnd="+Math.random()+""
		}
		window.top.document.getElementById("iframe_InBlackFrame").width=i_IframeWidth;
		window.top.document.getElementById("iframe_InBlackFrame").height=i_IframeHeight;
		window.top.document.getElementById("iframe_InBlackFrame").src=f_IframeSrc+RndStr;
		window.top.document.getElementById("iframe_InBlackFrame").style.display="none";
		

		if(checkBrowser()=="IE"&&checkBrowserIEVersion()=="6"){
			window.top.document.getElementById("div_OutBlackFrame").style.width=screen.width+"px";
			window.top.document.getElementById("div_OutBlackFrame").style.height=(screen.height*5)+"px";
			window.top.document.getElementById("iframe_InBlackFrame").style.left=((screen.width-parseInt(i_IframeWidth))/2)+"px";
			window.top.document.getElementById("div_closeIcon").style.left=((screen.width-parseInt(i_IframeWidth))/2)+"px";
			window.top.document.getElementById("div_frameLoading").style.left=((screen.width-parseInt(i_IframeWidth))/2)+"px";
		}
	}
}

function transferDivIframe(i_IframeWidth,i_IframeHeight,i_IframeSrc,i_Confirm,i_Effect){
	var confirmResult=false;
	if(i_Confirm!=""){
		if(confirm(i_Confirm)){
			confirmResult=true;
		}
		else{
			return;
		}
	}
	else{
		confirmResult=true;
	}
	
	if(confirmResult){
		var f_IframeSrc=i_IframeSrc;
		
		if(checkBrowser()=="IE"){
			window.top.document.getElementById("div_closeIcon").style.top=window.top.document.documentElement.scrollTop+"px";
			window.top.document.getElementById("iframe_InBlackFrame").style.top=window.top.document.documentElement.scrollTop+"px";
		}
		else{
			window.top.document.getElementById("div_closeIcon").style.top=window.top.document.body.scrollTop+"px";
			window.top.document.getElementById("iframe_InBlackFrame").style.top=window.top.document.body.scrollTop+"px";
		}
		
		window.top.document.getElementById("div_closeIcon").style.width=i_IframeWidth+"px";
		window.top.document.getElementById("div_frameLoading").style.width=i_IframeWidth+"px";
		window.top.document.getElementById("div_frameLoading").style.display="block"
		
		var RndStr="";
		if(f_IframeSrc.indexOf("?")>-1){
			RndStr="&rnd="+Math.random()+"";
		}
		else{
			RndStr="?rnd="+Math.random()+""
		}
		
		window.top.document.getElementById("iframe_InBlackFrame").width=i_IframeWidth;
		window.top.document.getElementById("iframe_InBlackFrame").height=i_IframeHeight;
		window.top.document.getElementById("iframe_InBlackFrame").src=f_IframeSrc+RndStr;
		window.top.document.getElementById("iframe_InBlackFrame").style.display="none";
		
		if(checkBrowser()=="IE"&&checkBrowserIEVersion()=="6"){
			window.top.document.getElementById("iframe_InBlackFrame").style.left=((screen.width-parseInt(i_IframeWidth))/2)+"px";
			window.top.document.getElementById("div_closeIcon").style.left=((screen.width-parseInt(i_IframeWidth))/2)+"px";
			window.top.document.getElementById("div_frameLoading").style.left=((screen.width-parseInt(i_IframeWidth))/2)+"px";
		}
	}
}

function hideDivIframe(i_CallerWndObj,i_GoAfterClose,i_R){
//i_CallerWndObj 将与 i_GoAfterClose 配合使用，解决由于showDivIframe是从Top调用而无法准确操作某些内部window的问题
//i_CallerWndObj 是个字符串，就是目标Iframe的名字或者"Top"，i_GoAfterClose是目标地址
//当i_CallerWndObj 为Top 但i_CallerWndObj 为空时那么i_CallerWndObj 刷新
//当i_CallerWndObj 为某个Iframe 的名字或者Id，但i_CallerWndObj 为空时那么那个父页面的Iframe刷新
//其他情况将i_CallerWndObj 指向的window 转向到 i_GoAfterClose的地址
//i_CallerWndObj 和 i_GoAfterClose 使用明文方式传入Div的目标页面
	
	//先执行这两行是因为怕底下的代码报错
	window.top.document.body.style.overflow="auto";
	window.top.document.getElementById("div_OutBlackFrame").style.display="none";
	window.top.document.getElementById("div_InBlackFrame").style.display="none";
	//下面这句很重要，如果只是隐藏，那么内容还在执行，比如视频播放的话，还能听到声音
	window.top.document.getElementById("iframe_InBlackFrame").src="about:blank";
	
	if(i_CallerWndObj=="Top"){
		if(i_GoAfterClose==""){
			window.top.location.href=window.top.location.href;
		}
		else{
			window.top.location.href=i_GoAfterClose;
		}
	}
	
	if((i_CallerWndObj!="")&&window.top.document.getElementById(i_CallerWndObj)){
		if(i_GoAfterClose==""){
			window.top.document.getElementById(i_CallerWndObj).contentWindow.location.reload();
		}
		else{
			window.top.document.getElementById(i_CallerWndObj).src=i_GoAfterClose;
		}
	}
	
	if(i_CallerWndObj=="Global"){
		if(window.top.location.href.indexOf("/Root/OperationFinishTransfer.asp")>0){
			window.top.location.href="/Member/MyAccount.asp?action=init";	
		}
	}
	
}

function hideDivIframeLoading(){
	window.top.document.getElementById("div_frameLoading").style.display="none";
	//window.top.document.getElementById("iframe_InBlackFrame").style.display="block"
	ReSizeiFrame(window.top.document.getElementById("iframe_InBlackFrame"));
	//window.top.document.getElementById("div_InBlackFrame").scrollIntoView(true);
}

var MouseOutObj=false;

function leaveObj(i_type){
	var windowTopObj;
	
	if(window.top==window){
		windowTopObj=window;
	}
	else{
		windowTopObj=window.top;
	}
	
	windowTopObj.MouseOutObj=true;
}

//向左滚动函数，demo包含demo1与demo2,speed是滚动速度，flag一个网页内有多个时设置为不同的任意字符。 
function toleft(demo,demo1,demo2,speed,flag,globalVar){
	frameObj=document.getElementById(demo);
	objFirst=document.getElementById(demo1);
	objSecond=document.getElementById(demo2);
	if(eval(globalVar)!="left"){
		eval(globalVar+"='left';");
		
		objSecond.innerHTML=objFirst.innerHTML;
		function Marquee(){ 
			if(objSecond.offsetWidth-frameObj.scrollLeft<=0){ 
				frameObj.scrollLeft-=objFirst.offsetWidth;
			} 
			else{ 
				frameObj.scrollLeft++;
			} 
		} 
	
		flag=setInterval(Marquee,speed);
		frameObj.onmouseover=function(){clearInterval(flag);eval(globalVar+"='stop';");} 
		//frameObj.onmouseout=function(){flag=setInterval(Marquee,speed);} 
	}
	
}

//向右滚动函数，demo包含demo1与demo2,speed是滚动速度，flag一个网页内有多个时设置为不同的任意字符。 
function toright(demo,demo1,demo2,speed,flag,globalVar){ 
	frameObj=document.getElementById(demo);
	objFirst=document.getElementById(demo1);
	objSecond=document.getElementById(demo2);
	if(eval(globalVar)!="right"){
		eval(globalVar+"='right';");
		
		objSecond.innerHTML=objFirst.innerHTML;
		function Marquee(){ 
			if(frameObj.scrollLeft<=0){ 
				frameObj.scrollLeft=objSecond.offsetWidth;
			} 
			else{ 
				frameObj.scrollLeft--;
			} 
		} 
	
		flag=setInterval(Marquee,speed);
		frameObj.onmouseover=function(){clearInterval(flag);eval(globalVar+"='stop';");} 
		//frameObj.onmouseout=function(){flag=setInterval(Marquee,speed);} 
	}
}

function buttonSubmitHide(submitObj_id,showObj_id,reserved){
	document.getElementById(submitObj_id).style.display="none";
	document.getElementById(showObj_id).style.display="block";
}

function buttonSubmitRestore(submitObj_id,showObj_id,reserved){
	document.getElementById(submitObj_id).style.display="block";
	document.getElementById(showObj_id).style.display="none";
}

function checkBrowser() { 
	if(window.navigator.userAgent.indexOf("MSIE")>=1){ 
		return "IE";
	}
	
	if(window.navigator.userAgent.indexOf("Firefox")>=1){ 
		return "Firefox";
	}
	
	if(window.navigator.userAgent.indexOf("Chrome")>=1){ 
		return "Chrome";
	}
	
	if(window.navigator.userAgent.indexOf("Safari")>=1){ 
		return "Safari";
	}
} 

function checkBrowserIEVersion(){
	if(window.navigator.userAgent.indexOf("MSIE 6.0")>=1){ 
		return "6";
	}
	
	if(window.navigator.userAgent.indexOf("MSIE 7.0")>=1){ 
		return "7";
	}
	
	if(window.navigator.userAgent.indexOf("MSIE 8.0")>=1){ 
		return "8";
	}
}

function getObjLeft(obj){
	var l=obj.offsetLeft - obj.parentNode.scrollLeft;
	while(obj=obj.offsetParent){
		l+=obj.offsetLeft;// - obj.parentNode.scrollLeft;
	}
	
	return l;

}

function getObjTop(obj){
   var t=obj.offsetTop - obj.parentNode.scrollTop;
   while(obj=obj.offsetParent){
      t+=obj.offsetTop; //- obj.parentNode.scrollTop;
   }
  return t;
}

function getObjLeftOriginal(obj){
   var l=obj.offsetLeft - obj.parentNode.scrollLeft;
   while(obj=obj.offsetParent){
      l+=obj.offsetLeft - obj.parentNode.scrollLeft;
   }
   return l;
}


function getObjTopOriginal(obj){
   var t=obj.offsetTop - obj.parentNode.scrollTop;
   while(obj=obj.offsetParent){
      t+=obj.offsetTop; //- obj.parentNode.scrollTop;
   }

  return t;
}

function getEvent() //同时兼容ie和ff的写法
    { 
        if(checkBrowser()=="IE") return window.event; 
        func=getEvent.caller;       
        while(func!=null){ 
            var arg0=func.arguments[0];
            if(arg0)
            {
              if((arg0.constructor==Event || arg0.constructor ==MouseEvent) || (typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation))
              { 
              return arg0;
              }
            }
            func=func.caller;
        }
        return null;
    }

function getMouseLeft() {

	var event=getEvent();

	if (checkBrowser()=="IE") {
		if(window.top==window){
			//return getObjLeft(event.srcElement);
			return event.x;
		}
		else{
			//return getObjLeft(event.srcElement)+getObjLeft(window.frameElement);
			return event.x + getObjLeft(window.frameElement);
		}
	}
	else {
		if(window.top==window){
			return event.pageX;
		}
		else{
			return getObjLeft(window.frameElement)+event.pageX;	
		}
	}
}

function getMouseTop() {
	var event=getEvent();
	if (checkBrowser()=="IE") {
		if(window.top==window){
			return getObjTop(event.srcElement);
			//return event.y;
		}
		else{
			//return getObjTop(event.srcElement)+getObjTop(window.frameElement);
			return event.y + getObjTop(window.frameElement);
		}
	}
	else{
		if(window.top==window){
			return event.pageY;
		}
		else{
			return event.pageY+getObjTop(window.frameElement);
		}
	}
}

function moveDiv(div){
	var divObj = window.top.document.getElementById(div);
	
	var topD=getMouseTop()-parseInt(divObj.style.top.replace("px",""));
	var leftD=getMouseLeft()-parseInt(divObj.style.left.replace("px",""))
	
	document.onmousemove = function ()
	{
		divObj.style.top=getMouseTop()-topD+"px";
		divObj.style.left=getMouseLeft()-leftD+"px";
	};
	
	document.onmouseup = function ()
	{
		document.onmousemove = null;
		document.onmouseup = null;
	};

}

function setCookie(i_Name, i_Value,i_Date){
	//date = new Date();
	document.cookie = i_Name + "=" + escape(i_Value) + ";";
}

function getCookie(sName){
	// cookies are separated by semicolons
	var aCookie = document.cookie.split("; ");
	for (var i=0; i < aCookie.length; i++){
		// a name/value pair (a crumb) is separated by an equal sign
		var aCrumb = aCookie[i].split("=");
		if (sName == aCrumb[0])
		return unescape(aCrumb[1]);
	}
	// a cookie with the requested name does not exist
	return null;
}

function hrefAddCondition(i_condition,i_value,i_R,i_R1){
	var WHref=window.location.href;

	//if condition and value both exist
	if((WHref.indexOf(i_condition+"=")>0)&&(WHref.substr(WHref.indexOf(i_condition+"=")+i_condition.length+1,1)!="")&&(WHref.substr(WHref.indexOf(i_condition+"=")+i_condition.length+1,1)!="&")){
		var oStr,oValue
		//[get old value and replace it]
		//get last str
		oStr=WHref.substr(WHref.indexOf(i_condition+"=")+i_condition.length+1);
		//if & in the last str
		if(oStr.indexOf("&")>0){
			//get the old value
			oValue=oStr.substr(0,oStr.indexOf("&"));
		}
		//this means this condition is the last condition in href str, so oStr is OValue
		else{
			oValue=oStr;
		}
		
		window.location.href=WHref.replace(i_condition+"="+oValue,i_condition+"="+i_value);		
		return;
	}
	
	//if this condition exists but no value
	if(WHref.indexOf(i_condition+"=")>0){

		window.location.href=WHref.replace(i_condition+"=",i_condition+"="+i_value);
		return;
	}

	//if this condition doesn't exist
	if(WHref.indexOf(i_condition+"=")==-1){
		window.location.href=WHref + "&" + i_condition + "=" + i_value;
		return;
	}	
}

function addToBatchValue(i_BatchObjId,i_CheckboxObjId,i_CheckboxValule){
	var f_Checkbox=document.getElementById(i_CheckboxObjId);
	var f_BarchObj=document.getElementById(i_BatchObjId);
	
	if(f_Checkbox.checked){
		if(f_BarchObj.value.search(","+i_CheckboxValule+",")>=0){
			//已经存在
			return;
		}	

		if(f_BarchObj.value==""){
			f_BarchObj.value=","+i_CheckboxValule+",";
		}
		else{
			f_BarchObj.value=f_BarchObj.value+i_CheckboxValule+",";
		}
		
		return;
	}
	else{
		//这个id在字符串中出现的位置
		var first_p=f_BarchObj.value.search(","+i_CheckboxValule+",");
		//如果有出现，其实一定会出现，因为都是刚才点进去的
		if(first_p!=-1){
			//出现在第一个
			if(first_p==0){
				f_BarchObj.value=f_BarchObj.value.substr(i_CheckboxValule.length+1);
	
				//最后如果里面只剩下一个逗号，那么去掉它
				if(f_BarchObj.value==","){
					f_BarchObj.value="";
				}
				
				return;
			}
			//出现在最后一个
			if(first_p==f_BarchObj.value.length-f_BarchObj.length-2){
				f_BarchObj.value=f_BarchObj.value.substr(0,first_p+1);
	
				//最后如果里面只剩下一个逗号，那么去掉它
				if(f_BarchObj.value==","){
					f_BarchObj.value="";
				}
				
				return;
			}
			
			//出现在中间
			f_BarchObj.value=f_BarchObj.value.substr(0,first_p+1)+f_BarchObj.value.substr(first_p+i_CheckboxValule.length+2);
	
			return;
		}
	}
}

function listCheckboxSelectAll(i_SelectAllObjId,i_BatchObjId,i_UBound,i_R){
	if(document.getElementById(i_SelectAllObjId).checked){
		for(i=0;i<=i_UBound;i++){
			if(document.getElementById("checkbox_"+i)){
				document.getElementById("checkbox_"+i).checked=true;
				addToBatchValue(i_BatchObjId,"checkbox_"+i,document.getElementById("checkbox_"+i).value);
			}	
		}
	}
	else{
		for(i=0;i<=i_UBound;i++){
			if(document.getElementById("checkbox_"+i)){
				document.getElementById("checkbox_"+i).checked=false;
			}
		}
		
		document.getElementById(i_BatchObjId).value="";
	}
}

//==========================================================================
function addToCart(i_M_Root,i_ProductId,i_PCId,i_ProductSize,i_Quantity,i_R){	
	showDivIframe(840,200,"/"+i_M_Root+"/Shopping/AddToShoppingCart.asp?action=init&addType=One&ProductId="+i_ProductId+"&PCId="+i_PCId+"&SBQuantity="+i_Quantity+"&SBProductSize="+i_ProductSize,"Top","","","fade");
}

function addToCartM(i_M_Root,i_ProductIds,i_PCIds,i_Quantitys,i_ProductSizes,i_R){	
	showDivIframe(840,200,"/"+i_M_Root+"/Shopping/AddToShoppingCart.asp?action=init&addType=More&ProductIds="+i_ProductIds+"&PCIds="+i_PCIds+"&SBQuantitys="+i_Quantitys+"&SBProductSizes="+i_ProductSizes,"Top","","","fade");
}

function addToCartM_withObjects(i_M_Root,i_ProductIds_ObjectId,i_PCIds_ObjectId,i_Quantitys_ObjectId,i_ProductSizes_ObjectId,i_R){
	var f_ProductIds=document.getElementById(i_ProductIds_ObjectId).value;
	var f_PCIds=document.getElementById(i_PCIds_ObjectId).value;
	var f_Quantitys=document.getElementById(i_Quantitys_ObjectId).value;
	var f_ProductSizes="";
	
	if(f_ProductIds==""){
		return false;
	}
	
	if(f_ProductIds!=""){
		f_ProductIds=f_ProductIds.substr(1,f_ProductIds.length-2);
	}
	
	if(f_PCIds!=""){
		f_PCIds=f_PCIds.substr(1,f_PCIds.length-2);
	}
	
	if(f_Quantitys!=""){
		f_Quantitys=f_Quantitys.substr(1,f_Quantitys.length-2);
	}
	
	addToCartM(i_M_Root,f_ProductIds,f_PCIds,f_Quantitys,f_ProductSizes,"");
}

function addPSToCart(i_M_Root,i_PSId,i_R){
	showDivIframe(840,200,"/"+i_M_Root+"/Shopping/AddToShoppingCart.asp?action=init&addType=PS&PSId="+i_PSId,"Top","","","fade");
}
