function correctPNG()  
{ 
for(var i=0; i<document.images.length; i++) 
{ 
  var img = document.images[i] 
  var imgName = img.src.toUpperCase() 
  if (imgName.substring(imgName.length-3, imgName.length) == "PNG") 
  { 
   var imgID = (img.id) ? "id='" + img.id + "' " : "" 
   var imgClass = (img.className) ? "class='" + img.className + "' " : "" 
   var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " 
   var imgStyle = "display:inline-block;" + img.style.cssText  
   if (img.align == "left") imgStyle = "float:left;" + imgStyle 
   if (img.align == "right") imgStyle = "float:right;" + imgStyle 
   if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle   
   var strNewHTML = "<span " + imgID + imgClass + imgTitle 
   + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" 
   + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" 
   + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"  
   img.outerHTML = strNewHTML 
   i = i-1 
  } 
} 
} 

// window.attachEvent("onload", correctPNG()); 

function show(i) {
	g1 = document.getElementById("ggg1");
	g11 = document.getElementById("ggg1_1");
	g12 = document.getElementById("ggg1_2");
	g13 = document.getElementById("ggg1_3");
	g2 = document.getElementById("ggg2");
	g21 = document.getElementById("ggg2_1");
	g22 = document.getElementById("ggg2_2");
	g23 = document.getElementById("ggg2_3");
	g3 = document.getElementById("ggg3");
	g31 = document.getElementById("ggg3_1");
	g32 = document.getElementById("ggg3_2");
	g33 = document.getElementById("ggg3_3");
	g4 = document.getElementById("ggg4");
	g41 = document.getElementById("ggg4_1");
	g42 = document.getElementById("ggg4_2");
	g43 = document.getElementById("ggg4_3");
	b1 = document.getElementById("bbb1");
	b2 = document.getElementById("bbb2");
	b3 = document.getElementById("bbb3");
	b4 = document.getElementById("bbb4");
	
	if (i == 1) {
		//g1.className = 'cr_info_tit21';
		g11.className = 'cr_info_tit22';
		g12.className = 'cr_info_tit23 tit14b red';
		g13.className = 'cr_info_tit24';
		//g2.className = 'cr_info_tit31';
		g21.className = 'cr_info_tit32';
		g22.className = 'cr_info_tit33 tit14b red';
		g23.className = 'cr_info_tit34';
		//g3.className = 'cr_info_tit31';
		g31.className = 'cr_info_tit32';
		g32.className = 'cr_info_tit33 tit14b red';
		g33.className = 'cr_info_tit34';
		//g4.className = 'cr_info_tit31';
		g41.className = 'cr_info_tit32';
		g42.className = 'cr_info_tit33 tit14b red';
		g43.className = 'cr_info_tit34';
		b1.style.display = '';
		b2.style.display = 'none';
		b3.style.display = 'none';
		b4.style.display = 'none';
	}
	if (i == 2) {
		//g2.className = 'cr_info_tit21';
		g21.className = 'cr_info_tit22';
		g22.className = 'cr_info_tit23 tit14b red';
		g23.className = 'cr_info_tit24';
		//g1.className = 'cr_info_tit31';
		g11.className = 'cr_info_tit32';
		g12.className = 'cr_info_tit33 tit14b red';
		g13.className = 'cr_info_tit34';
		//g3.className = 'cr_info_tit31';
		g31.className = 'cr_info_tit32';
		g32.className = 'cr_info_tit33 tit14b red';
		g33.className = 'cr_info_tit34';
		//g4.className = 'cr_info_tit31';
		g41.className = 'cr_info_tit32';
		g42.className = 'cr_info_tit33 tit14b red';
		g43.className = 'cr_info_tit34';
		b1.style.display = 'none';
		b2.style.display = '';
		b3.style.display = 'none';
		b4.style.display = 'none';
	}
	if (i == 3) {
		//g3.className = 'cr_info_tit21';
		g31.className = 'cr_info_tit22';
		g32.className = 'cr_info_tit23 tit14b red';
		g33.className = 'cr_info_tit24';
		//g2.className = 'cr_info_tit31';
		g21.className = 'cr_info_tit32';
		g22.className = 'cr_info_tit33 tit14b red';
		g23.className = 'cr_info_tit34';
		//g1.className = 'cr_info_tit31';
		g11.className = 'cr_info_tit32';
		g12.className = 'cr_info_tit33 tit14b red';
		g13.className = 'cr_info_tit34';
		//g4.className = 'cr_info_tit31';
		g41.className = 'cr_info_tit32';
		g42.className = 'cr_info_tit33 tit14b red';
		g43.className = 'cr_info_tit34';
		b1.style.display = 'none';
		b2.style.display = 'none';
		b3.style.display = '';
		b4.style.display = 'none';
	}
	if(i==4){
		//g4.className = 'cr_info_tit21';
		g41.className = 'cr_info_tit22';
		g42.className = 'cr_info_tit23 tit14b red';
		g43.className = 'cr_info_tit24';
		//g2.className = 'cr_info_tit31';
		g21.className = 'cr_info_tit32';
		g22.className = 'cr_info_tit33 tit14b red';
		g23.className = 'cr_info_tit34';
		//g3.className = 'cr_info_tit31';
		g31.className = 'cr_info_tit32';
		g32.className = 'cr_info_tit33 tit14b red';
		g33.className = 'cr_info_tit34';
		//g1.className = 'cr_info_tit31';
		g11.className = 'cr_info_tit32';
		g12.className = 'cr_info_tit33 tit14b red';
		g13.className = 'cr_info_tit34';
		b1.style.display = 'none';
		b2.style.display = 'none';
		b3.style.display = 'none';
		b4.style.display = '';
		}
}

function showForum(i) {
	g11 = document.getElementById("gggg1_1");
	g12 = document.getElementById("gggg1_2");
	g13 = document.getElementById("gggg1_3");
	g21 = document.getElementById("gggg2_1");
	g22 = document.getElementById("gggg2_2");
	g23 = document.getElementById("gggg2_3");
	b1 = document.getElementById("bbbb1");
	b2 = document.getElementById("bbbb2");
	if (i == 1) {
		g11.className = 'pro_infor_column_leftimg';
		g12.className = 'pro_infor_column_name';
		g13.className = 'pro_infor_column_rightimg';
		g21.className = 'pro_infor_column_leftimg_2';
		g22.className = 'pro_infor_column_name_2';
		g23.className = 'pro_infor_column_rightimg_2';
		b1.style.display = '';
		b2.style.display = 'none';

	}
	if (i == 2) {
		g11.className = 'pro_infor_column_leftimg_2';
		g12.className = 'pro_infor_column_name_2';
		g13.className = 'pro_infor_column_rightimg_2';
		g21.className = 'pro_infor_column_leftimg';
		g22.className = 'pro_infor_column_name';
		g23.className = 'pro_infor_column_rightimg';
		b1.style.display = 'none';
		b2.style.display = '';
		document.getElementById("cwin").onload();

	}
}

function showPFA(i) {
	g11 = document.getElementById("ggfa1_1");
	g12 = document.getElementById("ggfa1_2");
	g13 = document.getElementById("ggfa1_3");
	g21 = document.getElementById("ggfa2_1");
	g22 = document.getElementById("ggfa2_2");
	g23 = document.getElementById("ggfa2_3");
	b1 = document.getElementById("bbfa1");
	b2 = document.getElementById("bbfa2");
	if (i == 1) {
		g11.className = 'cr_info_tit22';
		g12.className = 'cr_info_tit23 tit14b red';
		g13.className = 'cr_info_tit24" id="ggfa1_3';
		g21.className = 'cr_info_tit32';
		g22.className = 'cr_info_tit33 tit14b red';
		g23.className = 'cr_info_tit34';
		b1.style.display = '';
		b2.style.display = 'none';
	}
	if (i == 2) {
		g21.className = 'cr_info_tit22';
		g22.className = 'cr_info_tit23 tit14b red';
		g23.className = 'cr_info_tit24" id="ggfa1_3';
		g11.className = 'cr_info_tit32';
		g12.className = 'cr_info_tit33 tit14b red';
		g13.className = 'cr_info_tit34';
		b2.style.display = '';
		b1.style.display = 'none';
	}
}

function showli(id) {
	li = document.getElementById(id);
	if (li.style.display == '')
		li.style.display = 'none';
	else
		li.style.display = '';
}

x = 0 ;
y = 0;
var t;
function getPageScroll(){
  var xScroll, yScroll;
  if (self.pageYOffset || self.pageXOffset) {
    xScroll = self.pageXOffset;
    yScroll = self.pageYOffset;
  } else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) {   // Explorer 6 Strict
    xScroll = document.documentElement.scrollLeft;
    yScroll = document.documentElement.scrollTop;
  } else if (document.body) {// all other Explorers
    xScroll = document.body.scrollTop;
    yScroll = document.body.scrollTop;
  }

  pageScroll = {xScroll: xScroll, yScroll: yScroll};
  return pageScroll;
}
function getOffset(obj) {
    var offset = {offsetLeft: 0, offsetTop: 0};
    while (obj) {
        offset.offsetLeft += obj.offsetLeft;
        offset.offsetTop += obj.offsetTop;
        obj = obj.offsetParent;
    }
    return offset;
};

function showallcategorys(obj)
{
	opos=getPageScroll();
	box = document.getElementById("allcategorysbox");
	obj = document.getElementById("controller");
	oRect = getOffset(obj);
	x = oRect.offsetLeft  ;
	y = oRect.offsetTop + 25 ;
	if (document.all){
		x = x - 2;
		y = y + 1;
	}
	else{
		y = y + 2;
	}
	box.style.left = x.toString() +'px';
	box.style.top = y.toString() +'px';
	if (box.style.display == 'none')
		box.style.display = ''; 
}
function showallcategorys1(obj)
{
	opos=getPageScroll();
	box = document.getElementById("allcategorysbox1");
	obj = document.getElementById("controller1");
	oRect = getOffset(obj);
	x = oRect.offsetLeft  ;
	y = oRect.offsetTop + 25 ;
	if (document.all){
		x = x - 2;
		y = y + 1;
	}
	else{
		y = y + 2;
	}
	box.style.left = x.toString() +'px';
	box.style.top = y.toString() +'px';
	if (box.style.display == 'none')
		box.style.display = ''; 
}
function showallcategorys2(obj)
{
	opos=getPageScroll();
	box = document.getElementById("allcategorysbox2");
	obj = document.getElementById("controller2");
	oRect = getOffset(obj);
	x = oRect.offsetLeft  ;
	y = oRect.offsetTop + 25 ;
	if (document.all){
		x = x - 2;
		y = y + 1;
	}
	else{
		y = y + 2;
	}
	box.style.left = x.toString() +'px';
	box.style.top = y.toString() +'px';
	if (box.style.display == 'none')
		box.style.display = ''; 
}

function hidecategorybox(){
	document.getElementById('allcategorysbox1').style.display = 'none';
	document.getElementById('allcategorysbox2').style.display = 'none';
	t = setTimeout("hidebox()",2500);
}
function hidecategorybox1(){
	document.getElementById('allcategorysbox').style.display = 'none';
	document.getElementById('allcategorysbox2').style.display = 'none';
	t1 = setTimeout("hidebox1()",2500);
}
function hidecategorybox2(){
	document.getElementById('allcategorysbox').style.display = 'none';
	document.getElementById('allcategorysbox1').style.display = 'none';
	t2 = setTimeout("hidebox2()",2500);
}
function hidebox(vv){
	if (vv != null || t != null)
		document.getElementById('allcategorysbox').style.display = 'none';
}
function loadme(){
	clearTimeout(t);
	t = null;
	document.getElementById('allcategorysbox').style.display = '';
}
function hidebox1(vv){
	if (vv != null || t1 != null)
		document.getElementById('allcategorysbox1').style.display = 'none';
}
function loadme1(){
	clearTimeout(t1);
	t1 = null;
	document.getElementById('allcategorysbox1').style.display = '';
}
function hidebox2(vv){
	if (vv != null || t2 != null)
		document.getElementById('allcategorysbox2').style.display = 'none';
}
function loadme2(){
	clearTimeout(t2);
	t2 = null;
	document.getElementById('allcategorysbox2').style.display = '';
}
var countdig = 0;
function DiggProduct(SiteID,ProductID) {
	if(ProductID<=0){alert("Item does not exist.");AlertInfoAdd("Item does not exist.",1,ProductID);return false;}
	if(countdig == 0)
	{
		postData = "";
		postData = postData + "SiteID="+SiteID+"&ProductID="+ProductID;
		$.ajax({
		  type:'get',
		  url:jsMainSiteUrl+'AjaxProductStatistic.cfm',
		  data:postData,
		  error:function(XMLHttpRequest, textStatus, errorThrown){
								AlertInfoAdd("Digg me AJAX Error."+textStatus+"-"+errorThrown,4,ProductID);
							},
		  success:function(result){
			    document.getElementById('diggcc').innerHTML = result;
			  	if(document.getElementById('diggcc2') != null){document.getElementById('diggcc2').innerHTML = result;}
				if(document.getElementById('strdiggme')!=null){document.getElementById('strdiggme').innerHTML = "Thanks";}
				if(document.getElementById('strdiggme2')!=null){document.getElementById('strdiggme2').innerHTML = "Thanks";}
		  }
		});
		countdig = 1;
	}
}

function checkqty(DDate,t)
{
	if(document.getElementById("BuyType")){
		document.getElementById("BuyType").value=0;
	}
	if(DDate>0){
		var WDateCheck = checkWDate(DDate);
		if(!WDateCheck)return false;
	}
	var isSub=1;
	if(t){
		isSub=0
	}
	var str=/^\d{1,5}$/;
	var str2=/^[a-zA-Z0-9 ]*$/;
	var qty=document.getElementById("Qty").value;
	var pid=document.getElementById("ProductID").value;
	var norow = 0;
	if(document.getElementById("ring_norow")){
		norow = document.getElementById("ring_norow").value;
	}
	if(str.test(qty) && qty != 0){
		var iHobby = 0;
		try{iHobby = document.getElementById("HobbyCount").value;}catch(e){}
		var bS = true;
		var strMsg = "";
		for(i = 1;i <= iHobby;i++) {
			
			try {
				var mccount = document.getElementById("MCCount"+i).value;
				if(mccount > 1){
					var mcmain = document.getElementById("mc_main"+i);
					var hobbyvalue0 = document.getElementById("Hobby"+i).value;
					var hobbyvalue1 = document.getElementById("Hobby"+i+1).value;
					var hobbyvalue2 = 0;
					if(mccount>=3){
						hobbyvalue2 = document.getElementById("Hobby"+i+2).value;
					}
					if(hobbyvalue0 == hobbyvalue1) {
						document.getElementById("Hobby"+i+1).value = 0;
						hobbyvalue1 = 0;
					}
					if(hobbyvalue0 == hobbyvalue2 || hobbyvalue1 == hobbyvalue2) {
						document.getElementById("Hobby"+i+2).value = 0;
						hobbyvalue2 = 0;
					}
					if(hobbyvalue1 == 0 && hobbyvalue2 != 0) {
						document.getElementById("Hobby"+i+1).value = hobbyvalue2;
						document.getElementById("Hobby"+i+2).value = 0;
					}
				}
			} catch(e) {}
			if(document.getElementById("Hobby" + i).disabled==true){
				if( document.getElementById("isCustom")!=null && document.getElementById("isCustom").checked==true){
					var ItemRow = document.getElementById("HobbyItemRow").value;
					for(var j = 1;j <= ItemRow;j++) {
						if(document.getElementById("isCurtain")){
							if(isNaN(document.getElementById("HobbyItem" + j).value) || document.getElementById("HobbyItem" + j).value<0 || document.getElementById("HobbyItem" + j).value.replace(/^\s\s*/,"").replace(/\s\s*$/,"") == ""){
								strMsg = "Length or Width must be numbers.";
								bS = bS && false;
								alert(strMsg);
								return false;
							}else if(document.getElementById("HobbyItemName"+j).value==document.getElementById("fixname").value && (parseFloat(document.getElementById("HobbyItem" + j).value)>parseFloat(document.getElementById("fixmax").value) || parseFloat(document.getElementById("HobbyItem" + j).value)<parseFloat(document.getElementById("fixmin").value)) && parseFloat(document.getElementById("fixmax").value)>0){
								document.getElementById("HobbyItem" + j).value = parseFloat(document.getElementById("fixmax").value);
								document.getElementById("HobbyItem" + j).focus();
								bS = bS && false;
							}
						}else if (document.getElementById("HobbyItem" + j).value.replace(/^\s\s*/,"").replace(/\s\s*$/,"") == "") {
							strMsg = strMsg + document.getElementById("HobbyItemName" + j).value + "/";
							bS = bS && false;
						}
					}
				}else{
					if (document.getElementById("Hobby" + i).value == 0 && i != norow) {
						strMsg = strMsg + document.getElementById("HobbyName" + i).value + "/";
						bS = bS && false;
					}
				}
				
			}else{
				if (document.getElementById("Hobby" + i).value == 0 && i != norow) {
					strMsg = strMsg + document.getElementById("HobbyName" + i).value + "/";
					bS = bS && false;
				}else{
					if(document.getElementById("isCustom")!=null && document.getElementById("isCustom").checked==true){
						var ItemRow = document.getElementById("HobbyItemRow").value;
						for(var j = 1;j <= ItemRow;j++) {
							if(document.getElementById("engraved")){
								if(document.getElementById("HobbyItem" + j).value.replace(/^\s\s*/,"").replace(/\s\s*$/,"") == ""){
									strMsg = "Please enter engraved message.";
									document.getElementById("HobbyItem" + j).focus();
									bS = bS && false;
									alert(strMsg);
									return false;
								}else if(!str2.test(document.getElementById("HobbyItem" + j).value.replace(/^\s\s*/,"").replace(/\s\s*$/,""))){
									strMsg = "Letters, numbers and spaces only.";
									document.getElementById("HobbyItem" + j).focus();
									bS = bS && false;
									alert(strMsg);
									return false;
								}else if(document.getElementById("engraved").checked==false){
									strMsg = "Please confirm that the engraved message you entered is correct.";
									bS = bS && false;
									alert(strMsg);
									return false;
								}
							}
						}
					}
				}
			}
		}
		if (bS==true){
			if(isSub==1){
				try{
					var pkid = document.getElementById("jsProductKey").value;
					_gaq.push(['_trackEvent','Shopcart', 'Add to Cart', pkid, qty]);
				}catch(e){}
				document.getElementById("proinfo").submit();
			}else{
				return true;
			}
			//AddToCart();
		}else{
			if(strMsg.substr(0, strMsg.length - 1)!=""){
				alert("please select " + strMsg.substr(0, strMsg.length - 1) + ".");
				return false;
			}
		}
	}else{
		alert("Please fill correct quantity number.");
		document.getElementById("Qty").value=1;
		return false;
	}
}


function goVideo(gd) 
{
	vcur += gd;
	vcur = Math.min(vcount - 2, Math.max(1, vcur));
	
	for (i = 1;i <= vcount;i++) {
		if (i >= vcur && i <= vcur + 2)
			document.getElementById("VideoView" + i).style.display = "";
		else
			document.getElementById("VideoView" + i).style.display = "none";
	}
}

function playVideo(gc) {
	strVideo = document.getElementById("VideoPath" + gc).value;
	
	strObject = "";
	strObject += "<object width=\"640\" height=\"385\">";
	strObject += "<param name=\"movie\" value=\"" + strVideo + "&hl=en&fs=1\"></param>";
	strObject += "<param name=\"allowFullScreen\" value=\"true\"></param>";
	strObject += "<param name=\"allowscriptaccess\" value=\"always\"></param>";
	strObject += "<embed src=\"" + strVideo + "&hl=en&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"640\" height=\"385\"></embed>";
	strObject += "</object>";
	
	document.getElementById("VideosPlayer").innerHTML = strObject;
}

//This function needs more arguments
function changeProductPic(move,id, T_Image_Path, Site_Image_Path)
{
	// move = 1 ????2??? move = 2 ????2???
	var strTable = "";
	var moveRight = 1;
	if (move == 2)
	{
		if (id < arrPic.length)
		{
			strTable = '<li class="rolling_btn"><img src="' + T_Image_Path + 'btn_img_03.jpg" style="cursor:pointer;" onClick="changeProductPic(1,'+id+');" /></li>';
			strTable = strTable + '<li class="rolling_img">';
			strTable = strTable + '<div class="rolling_img_img"><img src="' + Site_Image_Path +arrPic[id]+'"  border="0" /></a></div>';
			if (id < arrPic.length-1)
			{
				strTable = strTable + '<div class="rolling_img_img"><img src="' + Site_Image_Path +arrPic[id+1]+'"  border="0" /></a></div>';
				moveRight = 2;
			}else
			{
				strTable = strTable + '<div class="rolling_img_img">&nbsp;</div>';
			}
			strTable = strTable + '</li>';
if ((id+moveRight) >= arrPic.length)
{
strTable = strTable + '<li class="rolling_btn"><img src="' + T_Image_Path + 'btn_img_02_no.jpg" style="cursor:pointer;"  /></li>';

}else{
			strTable = strTable + '<li class="rolling_btn"><img src="' + T_Image_Path + 'btn_img_02.jpg" style="cursor:pointer;" onClick="changeProductPic(2,'+(id+moveRight)+');" /></li>';
}
			document.getElementById('ProductPicShow').innerHTML = strTable;
		}
	}else
	{
		if (id > 0)
		{
if ((id-2) <= 0)
{
strTable = '<li class="rolling_btn"><img src="' + T_Image_Path + 'btn_img_03_no.jpg" style="cursor:pointer;" /></li>';
}else{
			strTable = '<li class="rolling_btn"><img src="' + T_Image_Path + 'btn_img_03.jpg" style="cursor:pointer;" onClick="changeProductPic(1,'+(id-2)+');" /></li>';
}
			strTable = strTable + '<li class="rolling_img">';
			strTable = strTable + '<div class="rolling_img_img"><img src="' + Site_Image_Path + arrPic[id-2]+'" border="0" /></a></div>';
			strTable = strTable + '<div class="rolling_img_img"><img src="' + Site_Image_Path + arrPic[id-1]+'"  border="0" /></a></div>';
			strTable = strTable + '</li>';
			strTable = strTable + '<li class="rolling_btn"><img src="' + T_Image_Path + 'btn_img_02.jpg" style="cursor:pointer;" onClick="changeProductPic(2,'+id+');" /></li>';
			document.getElementById('ProductPicShow').innerHTML = strTable;
		}
	}
}

function ShowCategoryAuto(LiName, DivName, CategoryNumber)
{
	opos = getPageScroll();
	box = document.getElementById(DivName + CategoryNumber);
	obj = document.getElementById(LiName + CategoryNumber);
	if(box == null || obj == null)
	{
		return;	
	}
	oRect = getOffset(obj);
	x = oRect.offsetLeft;
	y = oRect.offsetTop + 25 ;
	if (document.all)
	{
		x = x - 2;
		y = y + 1;
	}
	else
	{
		y = y + 2;
	}
	//box.style.left = x.toString() +'px';
	//box.style.top = y.toString() +'px';
	if (box.style.display == 'none')
	{
		box.style.display = '';
	}
}
function HideCategoryAuto(DivName, CategoryCount)
{
	for(var i = 0; i <= CategoryCount; i ++)
	{
		if(document.getElementById(DivName + i) != null)
		{
			document.getElementById(DivName + i).style.display = 'none';	
		}
	}	
	TimeCounter = setTimeout("HideCategory()", 2500);
}
function HideCategory(Div)
{
	if (Div != null)
	{
		document.getElementById(Div).style.display = 'none';
	}
}
function ShowCategory(Div)
{
	clearTimeout(TimeCounter);
	TimeCounter = null;
	document.getElementById(Div).style.display = '';
}


function PlayVideo2(url,id,ucnt,dcnt,icnt){
		if(typeof(ucnt) != "undefined" && ucnt != 1 ){
		for( var i = 1; i < ucnt ; i++ ){
			document.getElementById("UserVideo_"+i).className = "div_pro_videoshow";
		}	
	}
	if(typeof(dcnt) != "undefined" && dcnt != 1){
		for( var j = 1; j < dcnt ; j++ ){
			document.getElementById("DinoVideo_"+j).className = "div_pro_videoshow";
		}
	}
	if(typeof(icnt) != "undefined" && icnt != 0){
		for( var j = 1; j <= icnt ; j++ ){
			document.getElementById("IndexVideo_"+j).className = "div_pro_videoshow";
		}	
	}
	document.getElementById(id).className = "current_videoshow";
	strObject = "";
	strObject += "<object width=\"640\" height=\"385\">";
	strObject += "<param name=\"movie\" value=\"" + url + "&hl=en&fs=1\"></param>";
	strObject += "<param name=\"allowFullScreen\" value=\"true\"></param>";
	strObject += "<param name=\"allowscriptaccess\" value=\"always\"></param>";
	strObject += "<embed src=\"" + url + "&hl=en&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"640\" height=\"385\"></embed>";
	strObject += "</object>";
	document.getElementById("divEnlarge").innerHTML = strObject;
}
		function SetCwinHeight()
		{
			var cwin=document.getElementById("cwin");
			var availWidth=parseInt(window.screen.availWidth);
			if (document.getElementById)
			{
				if (cwin && !window.opera)
				{
					if (cwin.contentDocument && cwin.contentDocument.body.offsetHeight){
						cwin.height = cwin.contentDocument.body.offsetHeight; 
						}
					else if(cwin.Document && cwin.Document.body.scrollHeight){
						cwin.height = cwin.Document.body.scrollHeight+20;
						}
				}
				else
				{
					if (cwin.contentDocument && cwin.contentDocument.body.offsetHeight){
						cwin.height = cwin.contentDocument.body.offsetHeight; 
						}
					else if(cwin.Document && cwin.Document.body.scrollHeight)
						cwin.height = cwin.Document.body.scrollHeight+20;
				}
			}
		}
		
function AddToCart()
{
	try
	{
		document.body.style.cursor = "wait";
		var Form = document.getElementById("proinfo");
		Form.target = "ShoppingCartIframe";
		if(document.getElementById("txt_Check") != null)
		{
			document.getElementById("txt_Check").value = "Check";
		}
		else
		{
			var input = document.createElement("input");
			input.id = "txt_Check";
			input.name = "txt_Check";
			input.type = "hidden";
			input.value = "Check";
			input.style.display = "none";
			Form.appendChild(input);
		}
		Form.submit();
		AddCartControler(0);
	}
	catch(e)
	{
		document.body.style.cursor = "";
		//DialogBeReady("BackToIndexPage");
	}
}

var TempCartItem = 0;
function Continue()
{
	try
	{
		var Form = document.getElementById("proinfo");
		Form.target = "ShoppingCartIframe";
		if(document.getElementById("txt_Check") != null)
		{
			document.getElementById("txt_Check").value = "Continue";
		}
		else
		{
			var input = document.createElement("input");
			input.id = "txt_Check";
			input.name = "txt_Check";
			input.type = "hidden";
			input.value = "Continue";
			input.style.display = "none";
			Form.appendChild(input);
		}
		Form.submit();
		DialogHide();
		AddCartControler(1);
		cartitem = TempCartItem;
		loaduserinfo();
	}
	catch(e)
	{
		//DialogBeReady("BackToIndexPage");
	}
}

function GoCart()
{
	try
	{
		var Form = document.getElementById("proinfo");
		Form.target = ""
		if(document.getElementById("txt_Check") != null)
		{
			Form.removeChild(document.getElementById("txt_Check"));
		}
		else
		{
			DialogBeReady("BackToIndexPage");
			return;
		}
		Form.submit();
	}
	catch(e)
	{
		//DialogBeReady("BackToIndexPage");
	}
}

function AddCartControler(Type)
{
	if(document.getElementById("ImageBtn_AddCart") != null)
	{
		if(Type == 0)
		{	
			document.getElementById("ImageBtn_AddCart").blur();
			document.getElementById("ImageBtn_AddCart").style.cursor = "wait";
			document.getElementById("ImageBtn_AddCart").disabled = true;
		}
		else if(Type == 1)
		{
			document.getElementById("ImageBtn_AddCart").style.cursor = "pointer";
			document.getElementById("ImageBtn_AddCart").disabled = false;
		}
	}	
}		

function DialogBeReady(Message, Price, Quantity, ItemsNumber, SumMoney ,SoftislandId , indexURL)
{
	document.body.style.cursor = "";
	AddCartControler(1);
	if(Message != null && Message != "")
	{
		if(Message.toLowerCase() == "backtoindexpage")
		{
			window.location.href = indexURL;
		}
		else if (Message.toLowerCase() == "dailydeallimit")
		{
			if(Quantity <= 0)
			{
				alert("You have added the maximum quantity of this item to your shopping cart already.");	
			}
			else
			{
				alert("Please choose up to the maximum quantity displayed in the blank.");	
			}
			document.getElementById("Qty").value = Quantity;
		}
		else
		{
			alert(Message);
		}
		return false;	
	}
	
	var Array_Item = new Array();
	Array_Item[0] = "SKU|_*_|" + SoftislandId;
	
	var Quantity = document.getElementById("Qty").value;
	var iHobby = 0;
	try{iHobby = document.getElementById("HobbyCount").value;}catch(e){}

	for(i = 1; i <= iHobby; i++) 
	{
		Array_Item[i] = document.getElementById("HobbyName" + i).value + "|_*_|" + document.getElementById("Hobby" + i).options[document.getElementById("Hobby" + i).selectedIndex].text;
	}
	
	Array_Item[Array_Item.length] = "Price|_*_|" + Price;
	Array_Item[Array_Item.length] = "Quantity|_*_|" + Quantity;
	
	var Array_Property = new Array();
	if(ItemsNumber > 1)
	{
		Array_Property[0] = "Shopping Cart|_*_|" + ItemsNumber + " items";
	}
	else
	{
		Array_Property[0] = "Shopping Cart|_*_|" + ItemsNumber + " item";	
	}
	Array_Property[1] = "Subtotal|_*_|" + SumMoney;
	DialogShow(Array_Item,Array_Property);
	TempCartItem = ItemsNumber;
}

function UpdateTogeterFirstHoby(v,id){
	/*
	if(document.getElementById("HobbyTogether" + id + "_1")){
		document.getElementById("HobbyTogether" + id + "_1").value = v;
	}
	*/
}
function UpdateTogeterFirstCustom(){
	if(document.getElementById("isCustom") && document.getElementById("isCustomTogeter")){
		if(document.getElementById("isCustom").checked){
			document.getElementById("isCustomTogeter").value = document.getElementById("isCustom").value;
		}else{
			document.getElementById("isCustomTogeter").value = 0;
		}
	}
	if(document.getElementById("HobbyCount")){
		for(var i=1;i<=document.getElementById("HobbyCount").value;i++){
			if(document.getElementById("Hobby"+i) && document.getElementById("HobbyTogeter"+i)){
				document.getElementById("HobbyTogeter"+i).value = document.getElementById("Hobby"+i).value;
			}
		}
	}
	if(document.getElementById("HobbyItemRow")){
		for(var i=1;i<=document.getElementById("HobbyItemRow").value;i++){
			if(document.getElementById("HobbyItem"+i) && document.getElementById("HobbyItemTogeter"+i)){
				document.getElementById("HobbyItemTogeter"+i).value = document.getElementById("HobbyItem"+i).value;
			}
		}
	}
	if(document.getElementById("Qty")){
		document.getElementById("QtyTogether1").value = document.getElementById("Qty").value;
	}
	
}
function TogetherSubmit(){
	UpdateTogeterFirstCustom();
	var ptcount = document.getElementById("ProductCountTogether").value;
	var isCheck = 0;
	var bb = true;
	var bS = true;
	var strMsg = "";
	if(bb){
		for(var i=2;i<=ptcount;i++){
			var checkid = "checkboxTP"+i;
			if(document.getElementById(checkid).checked){
				if(document.getElementById("HobbyCountTogether"+i)){
					var hobbycount = document.getElementById("HobbyCountTogether"+i).value;
					for(var j=1;j<=hobbycount;j++){
						if(document.getElementById("HobbyTogether" + j + "_" + i)){
							if (document.getElementById("HobbyTogether" + j + "_" + i).value == 0) {
								strMsg = strMsg + document.getElementById("HobbyNameTogether" + j + "_" + i).value + "/";
								bS = bS && false;
							}
						}
					}
				}
			}
		}
		if (bS==true){
			document.getElementById("TogetherForm").submit();
			return false;
		}else{
			if(strMsg.substr(0, strMsg.length - 1)!=""){
				alert("please select " + strMsg.substr(0, strMsg.length - 1) + ".");
				return false;
			}
		}
	}
	return false;
}
function UpdateComboFirstCustom(cRow){
	if(document.getElementById("isCustom") && document.getElementById("isCustomCombo"+cRow)){
		if(document.getElementById("isCustom").checked){
			document.getElementById("isCustomCombo"+cRow).value = document.getElementById("isCustom").value;
		}else{
			document.getElementById("isCustomCombo"+cRow).value = 0;
		}
	}
	if(document.getElementById("HobbyCount")){
		for(var i=1;i<=document.getElementById("HobbyCount").value;i++){
			if(document.getElementById("Hobby"+i) && document.getElementById("HobbyCombo"+i+"_"+cRow+"_1")){
				document.getElementById("HobbyCombo"+i+"_"+cRow+"_1").value = document.getElementById("Hobby"+i).value;
			}
		}
	}
	if(document.getElementById("HobbyItemRow")){
		for(var i=1;i<=document.getElementById("HobbyItemRow").value;i++){
			if(document.getElementById("HobbyItem"+i) && document.getElementById("HobbyItemCombo"+i+"_"+cRow)){
				document.getElementById("HobbyItemCombo"+i+"_"+cRow).value = document.getElementById("HobbyItem"+i).value;
			}
		}
	}
	if(document.getElementById("Qty")){
		document.getElementById("QtyCombo"+cRow+"_1").value = document.getElementById("Qty").value;
	}
}
function ComboSubmit(cRow){
	UpdateComboFirstCustom(cRow);
	var bb = checkqty(0,1);
	if(bb){
		document.getElementById("ComboForm"+cRow).submit();
		return false;	
	}else{
		return false;	
	}
}
function clkchkTogether(){
	var trow = document.getElementById("ProductCountTogether").value;
	var tprice = document.getElementById("TogetherPrice1").value;
	var tsave = document.getElementById("TogetherSave1").value;
	var tpricesumobj = document.getElementById("TogetherPriceSum");
	var tsavesumobj = document.getElementById("TogetherSaveSum");
	var p = 0;
	var s = parseFloat(tsave);
	var op = 0;
	var ischeck = 0;
	for(var i=1;i<=trow;i++){
		if(document.getElementById("checkboxTP"+i).checked){
			var tempSale = document.getElementById("togethersalepriceInp"+i);
			var tempPValue = parseFloat(document.getElementById("producttogetheroldprice_"+i).innerHTML);
			if(tempSale!=null) {
				tempPValue = parseFloat(tempSale.value);
			}
			p = parseFloat(p) + parseFloat(document.getElementById("producttogetherprice_"+i).innerHTML);
			op = parseFloat(op) + parseFloat(tempPValue);
			if(i!=1){
				ischeck = 1;
			}
		}
	}
	if(jsCurName != "jpy" && jsCurName != 'idr' && jsCurName != 'rub')
	{
		tpricesumobj.innerHTML = getCurShow(jsCurName,jsSymbol,p.toFixed(2),1);
		tsavesumobj.innerHTML = getCurShow(jsCurName,jsSymbol,(op-p).toFixed(2),1);
	}
	else
	{
		tpricesumobj.innerHTML = getCurShow(jsCurName,jsSymbol,p.toFixed(0),1);
		tsavesumobj.innerHTML = getCurShow(jsCurName,jsSymbol,(op-p).toFixed(0),1);
	}
	if(document.getElementById("Togethe_Sum_Save")){
		if(ischeck==1){
			document.getElementById("Togethe_Sum_Save").style.display = "";
			document.getElementById("Togethe_Sum_Price").style.display = "";
		}else{
			document.getElementById("Togethe_Sum_Save").style.display = "none";
			document.getElementById("Togethe_Sum_Price").style.display = "none";
		}
	}
	return;
}

function listlen(strs,mit){
    var sums = 0; 
	for(i=0;i < strs.length;i++){
    	if(strs.charAt(i) == mit){
        	sums=sums+1;
        }
    }
    return sums;
}

function listtoarray(strs,mit){
	var arr = strs.split(mit);
    return arr;
}

function productrecord(ProductId,ProductName,FileName,SmallPhoto,Currency,IsDiscount,Discount,Price,IsFreeShipping,IsIdino){
	try{
		var vProductId = ProductId;
		var OldPrice = Price;
		var Delimiter = "@";  	
        if(ReadCookie("IV_ID") && ReadCookie("IV_PT")   && ReadCookie("IV_NAME") && ReadCookie("IV_PR") && ReadCookie("IV_FNAME") && ReadCookie("IV_CUR") 
		&& listlen(ReadCookie("IV_ID"), Delimiter) == listlen(ReadCookie("IV_CUR"), Delimiter) 
		&&	listlen(ReadCookie("IV_ID"), Delimiter) == listlen(ReadCookie("IV_FNAME"), Delimiter) 
		&&	listlen(ReadCookie("IV_ID"), Delimiter) == listlen(ReadCookie("IV_PR"), Delimiter)
		&&	listlen(ReadCookie("IV_ID"), Delimiter) == listlen(ReadCookie("IV_NAME"), Delimiter)
		&&	listlen(ReadCookie("IV_ID"), Delimiter) == listlen(ReadCookie("IV_PT"), Delimiter)
		&&	listlen(ReadCookie("IV_ID"), Delimiter) == listlen(ReadCookie("IV_OPR"), Delimiter)
		&&	listlen(ReadCookie("IV_ID"), Delimiter) == listlen(ReadCookie("IV_IFS"), Delimiter)
		&&  listlen(ReadCookie("IV_ID"), Delimiter) == listlen(ReadCookie("IV_IDINO"), Delimiter)){
		   var Array_ProductID = listtoarray(ReadCookie("IV_ID"), Delimiter);
		   var Array_ProductName = listtoarray(ReadCookie("IV_NAME"), Delimiter);
		   var Array_FileName = listtoarray(ReadCookie("IV_FNAME"), Delimiter);
		   var Array_SmallPhoto = listtoarray(ReadCookie("IV_PT"), Delimiter);
		   var Array_Currency = listtoarray(ReadCookie("IV_CUR"), Delimiter);
		   var Array_Price = listtoarray(ReadCookie("IV_PR"), Delimiter);
		   var Array_OldPrice = listtoarray(ReadCookie("IV_OPR"), Delimiter);
		   var Array_IsFreeShipping = listtoarray(ReadCookie("IV_IFS"), Delimiter);
		   var Array_IsIdino = listtoarray(ReadCookie("IV_IDINO"), Delimiter);
		   if(Array_ProductID.length >= 5 && ReadCookie("IV_ID").indexOf(vProductId) == -1){
			   Arrays_ProductID = "";
			   Arrays_ProductName = "";
			   Arrays_FileName = "";
			   Arrays_SmallPhoto = "";
			   Arrays_Currency = "";
			   Arrays_Price = "";
			   Arrays_OldPrice = "";
			   Arrays_IsFreeShipping = "";
			   Arrays_IsIdino = "";
			   for(i=0;i < 4;i++){
				   if(i==3){
					   	   Arrays_ProductID = Arrays_ProductID+Array_ProductID[i];
						   Arrays_ProductName = Arrays_ProductName+Array_ProductName[i];
						   Arrays_FileName = Arrays_FileName+Array_FileName[i];
						   Arrays_SmallPhoto = Arrays_SmallPhoto+Array_SmallPhoto[i];
						   Arrays_Currency = Arrays_Currency+Array_Currency[i];
						   Arrays_Price = Arrays_Price+Array_Price[i];
						   Arrays_OldPrice = Arrays_OldPrice+Array_OldPrice[i];
						   Arrays_IsFreeShipping = Arrays_IsFreeShipping+Array_IsFreeShipping[i];
						   Arrays_IsIdino = Arrays_IsIdino+Array_IsIdino[i];
					   }else{
					 	   Arrays_ProductID=Arrays_ProductID+ Array_ProductID[i]+Delimiter;
						   Arrays_ProductName = Arrays_ProductName+Array_ProductName[i]+Delimiter;
						   Arrays_FileName = Arrays_FileName+Array_FileName[i]+Delimiter;
						   Arrays_SmallPhoto = Arrays_SmallPhoto+Array_SmallPhoto[i]+Delimiter;
						   Arrays_Currency = Arrays_Currency+Array_Currency[i]+Delimiter;
						   Arrays_Price = Arrays_Price+Array_Price[i]+Delimiter;
						   Arrays_OldPrice = Arrays_OldPrice+Array_OldPrice[i]+Delimiter;
						   Arrays_IsFreeShipping = Arrays_IsFreeShipping+Array_IsFreeShipping[i]+Delimiter;
						   Arrays_IsIdino = Arrays_IsIdino+Array_IsIdino[i]+Delimiter;
					   }
			   }
			   var ProductId = ProductId+Delimiter+Arrays_ProductID;
			   var ProductName = ProductName+Delimiter+Arrays_ProductName;
			   var FileName = FileName+Delimiter+Arrays_FileName;
			   var SmallPhoto = SmallPhoto+Delimiter+Arrays_SmallPhoto;
			   var Currency = Currency+Delimiter+Arrays_Currency;
			   var OldPrice = OldPrice+Delimiter+Arrays_OldPrice;
			   var IsFreeShipping = IsFreeShipping+Delimiter+Arrays_IsFreeShipping;
			   var IsIdino = IsIdino+Delimiter+Arrays_IsIdino;
			   if(IsDiscount == 1 && Discount != 0 && Discount != "" && IsIdino==0){
					var Price = Price * (Discount / 100)+Delimiter+Arrays_Price;
			   }else{
					var Price = Price+Delimiter+Arrays_Price;
			   }
		   }else{
			   var ProductId = ProductId+Delimiter+ReadCookie("IV_ID");
			   var ProductName = ProductName+Delimiter+ReadCookie("IV_NAME");
			   var FileName = FileName+Delimiter+ReadCookie("IV_FNAME");
			   var SmallPhoto = SmallPhoto+Delimiter+ReadCookie("IV_PT");
			   var Currency = Currency+Delimiter+ReadCookie("IV_CUR");
			   var OldPrice = OldPrice+Delimiter+ReadCookie("IV_OPR");
			   var IsFreeShipping = IsFreeShipping+Delimiter+ReadCookie("IV_IFS");
			   var IsIdino = IsIdino+Delimiter+ReadCookie("IV_IDINO");
			   if(IsDiscount == 1 && Discount != 0 && Discount != "" && IsIdino==0){
					var Price = Price * (Discount / 100)+Delimiter+ReadCookie("IV_PR");
			   }else{
					var Price = Price+Delimiter+ReadCookie("IV_PR");
			   }
		   }
		} 	
		
        if(ReadCookie("IV_ID").indexOf(vProductId) == -1){
			SetCookie("IV_ID",  ProductId, 360);
			SetCookie("IV_NAME", ProductName, 360);
			SetCookie("IV_FNAME", FileName, 360);
			SetCookie("IV_PT", SmallPhoto, 360);
			SetCookie("IV_CUR", Currency, 360);
			SetCookie("IV_OPR", OldPrice, 360);
			SetCookie("IV_IFS", IsFreeShipping, 360);
			SetCookie("IV_IDINO", IsIdino, 360);
			if(ReadCookie("IV_PR")){
				SetCookie("IV_PR", Price, 360);
			}else{
				if(IsDiscount == 1 && Discount != 0 && Discount != ""){
					 SetCookie("IV_PR",Price * (Discount / 100), 360);	 
				}else{
					 SetCookie("IV_PR", Price, 360);
				}
			}
		}
  	}catch(e){}
}


var num = 1;
var num1 = 1;
function scrollright(lang,borm){
	if(borm == 0){
		document.getElementById("pro_detailadd2_011").style.display="block";
		if(num+5 != lang){
			for(i=1;i<=lang;i++){
				document.getElementById("pro_"+i).style.display="none";	
			}
			num =num+1;
			j=num;
			for(j;j<num+6;j++){
				document.getElementById("pro_"+j).style.display="block";	
			}
		}
		if(num+5 == lang){
				document.getElementById("pro_detailadd2_031").style.display="none";
			}
	}else if(borm == 1){
		document.getElementById("pro_detailadd2_01").style.display="block";
		if(num1+5 != lang){
			for(i=1;i<=lang;i++){
				document.getElementById("prom_"+i).style.display="none";	
			}
			num1 =num1+1;
			j=num1;
			for(j;j<num1+6;j++){
				document.getElementById("prom_"+j).style.display="block";	
			}
		}
		if(num1+5 == lang){	
				document.getElementById("pro_detailadd2_03").style.display="none";
		}
	}
}

function scrollleft(lang,borm){
	if(borm == 0){
		document.getElementById("pro_detailadd2_031").style.display="block";
		if(num != 1){
			for(i=1;i<=lang;i++){
				document.getElementById("pro_"+i).style.display="none";	
			}
			num =num-1;
			j=num;
			for(j;j<num+6;j++){
				document.getElementById("pro_"+j).style.display="block";	
			}
		}
		if(num == 1){
				document.getElementById("pro_detailadd2_011").style.display="none";
			}
	}else if(borm == 1){
		document.getElementById("pro_detailadd2_03").style.display="block";
		if(num1 != 1){
			for(i=1;i<=lang;i++){
				document.getElementById("prom_"+i).style.display="none";	
			}
			num1 =num1-1;
			j=num1;
			for(j;j<num1+6;j++){
				document.getElementById("prom_"+j).style.display="block";	
			}
		}
		if(num1 == 1){
				document.getElementById("pro_detailadd2_01").style.display="none";	
		}
	}
}
/*
function scrollright3(lang,borm){
	document.getElementById("pro_detailadd2_01").style.display="block";
	if(num1+4 != lang){
		for(i=1;i<=lang;i++){
			document.getElementById("prom_"+i).style.display="none";	
		}
		num1 =num1+5;
		j=num1;
		for(j;j<num1+5;j++){
			alert(document.getElementById("prom_"+j).style.display);
			if(document.getElementById("prom_"+j) != null)
				document.getElementById("prom_"+j).style.display="block";	
		}
	}
	if(num1>lang) {
		num1=1;
	}
	if(num1+4 == lang){	
			document.getElementById("pro_detailadd2_03").style.display="none";
	}
}

function scrollleft3(lang,borm){
	if(borm == 1){
		document.getElementById("pro_detailadd2_03").style.display="block";
		if(num1 != 1){
			for(i=1;i<=lang;i++){
				document.getElementById("prom_"+i).style.display="none";	
			}
			num1 =num1-5;
			if(num1 <=0)
				num1 = 1;
			j=num1;
			for(j;j<num1+5;j++){
				document.getElementById("prom_"+j).style.display="block";	
			}
		}
		if(num1 == 1){
				document.getElementById("pro_detailadd2_01").style.display="none";	
		}
	}
}*/

function scrollright3(lang,borm){
	document.getElementById("pro_detailadd2_01").style.display="block";
	if(num1+4 != lang){
		for(i=1;i<=lang;i++){
			document.getElementById("prom_"+i).style.display="none";	
		}
		num1 =num1+5;
		j=num1;
		for(j;j<num1+5;j++){
			alert(document.getElementById("prom_"+j).style.display);
			if(document.getElementById("prom_"+j) != null)
				document.getElementById("prom_"+j).style.display="block";	
		}
	}
	if(num1>lang) {
		num1=1;
	}
	if(num1+4 == lang){	
			document.getElementById("pro_detailadd2_03").style.display="none";
	}
}

function scrollleft3(lang,borm){
	if(borm == 1){
		document.getElementById("pro_detailadd2_03").style.display="block";
		if(num1 != 1){
			for(i=1;i<=lang;i++){
				document.getElementById("prom_"+i).style.display="none";	
			}
			num1 =num1-5;
			if(num1 <=0)
				num1 = 1;
			j=num1;
			for(j;j<num1+5;j++){
				document.getElementById("prom_"+j).style.display="block";	
			}
		}
		if(num1 == 1){
				document.getElementById("pro_detailadd2_01").style.display="none";	
		}
	}
}

var thisNum = 1;
var totleTabNum = 0;
var intervalIds = "";
var isMove = false;
var isHover = false;
var uaVer = navigator.userAgent.toLowerCase();
var isIE6 = false;
if(window.ActiveXObject) {
	var ver = uaVer.match(/msie ([\d.]+)/)[1];
	if(ver.indexOf("6")!=-1) {
		isIE6 = true;
	}
}
function scrollright2(lang,borm){
	if(!isIE6) {
		if(!isMove) {
			isMove = true;
			clearAllTimeOut();
			totleTabNum = Math.ceil(lang/5);
			var thisWidth = jQuery("#MoveTab_"+thisNum).width();
			jQuery("#MoveTab_"+thisNum).animate({left:'-='+thisWidth+'px'},100,function(){
				jQuery(this).hide();
				var nextNum = thisNum+1;
				if(nextNum>totleTabNum) {
					nextNum = 1;
					thisNum = 0;
				}
				jQuery("#MoveTab_"+nextNum).css('left',thisWidth+'px').show().find('ul').show();
				jQuery("#MoveTab_"+nextNum).animate({left:'-='+thisWidth+'px'},100,function(){
					thisNum += 1;
					if(!isHover) {
						intervalIds = intervalIds + "," + setInterval("scrollright2("+lang+",1)",3000);
					}
					isMove = false;
					jQuery(".pageNoDiv_Inner").html("(Page of "+nextNum+"/"+totleTabNum+")");
				});
			});
		}
	} else {
		clearAllTimeOut();
		totleTabNum = Math.ceil(lang/5);
		var thisWidth = jQuery("#MoveTab_"+thisNum).width();
		jQuery("#MoveTab_"+thisNum).hide();
		var nextNum = thisNum+1;
		if(nextNum>totleTabNum) {
			nextNum = 1;
			thisNum = 0;
		}
		jQuery("#MoveTab_"+nextNum).css('left',0).show().find('ul').show();
		thisNum += 1;
		if(!isHover) {
			intervalIds = intervalIds + "," + setInterval("scrollright2("+lang+",1)",3000);
		}
		jQuery(".pageNoDiv_Inner").html("(Page of "+nextNum+"/"+totleTabNum+")");
		//scrollright3(lang,borm);
	}
}

function scrollleft2(lang,borm){
	if(!isIE6) {
		if(!isMove) {
			isMove = true;
			clearAllTimeOut();
			totleTabNum = Math.ceil(lang/5);
			var thisWidth = jQuery("#MoveTab_"+thisNum).width();
			jQuery("#MoveTab_"+thisNum).animate({left:'+='+thisWidth+'px'},100,function(){
				jQuery(this).hide();
				var prevNum = thisNum-1;
				if(prevNum<=0) {
					prevNum = totleTabNum;
					thisNum = totleTabNum +1 ;
				}
				jQuery("#MoveTab_"+prevNum).css('left','-'+thisWidth+'px').show().find('ul').show();
				jQuery("#MoveTab_"+prevNum).animate({left:'+='+thisWidth+'px'},100,function(){
					thisNum -= 1;
					if(!isHover) {
						intervalIds = intervalIds + "," + setInterval("scrollright2("+lang+",1)",3000);
					}
					isMove = false;
					jQuery(".pageNoDiv_Inner").html("(Page of "+prevNum+"/"+totleTabNum+")");
				});
			});
		}
	} else {
		clearAllTimeOut();
		totleTabNum = Math.ceil(lang/5);
		var thisWidth = jQuery("#MoveTab_"+thisNum).width();
		jQuery("#MoveTab_"+thisNum).hide();
		var prevNum = thisNum-1;
		if(prevNum<=0) {
			prevNum = totleTabNum;
			thisNum = totleTabNum +1 ;
		}
		jQuery("#MoveTab_"+prevNum).css('left',0).show().find('ul').show();
		thisNum -= 1;
		if(!isHover) {
			intervalIds = intervalIds + "," + setInterval("scrollright2("+lang+",1)",3000);
		}
		jQuery(".pageNoDiv_Inner").html("(Page of "+prevNum+"/"+totleTabNum+")");
		//scrollleft3(lang,borm);
	}
}

function scrollright3(lang,borm){
	if(!isIE6) {
		if(!isMove) {
			isMove = true;
			clearAllTimeOut();
			totleTabNum = Math.ceil(lang/5);
			var thisWidth = jQuery("#hot_MoveTab_"+thisNum).width();
			jQuery("#hot_MoveTab_"+thisNum).animate({left:'-='+thisWidth+'px'},100,function(){
				jQuery(this).hide();
				var nextNum = thisNum+1;
				if(nextNum>totleTabNum) {
					nextNum = 1;
					thisNum = 0;
				}
				jQuery("#hot_MoveTab_"+nextNum).css('left',thisWidth+'px').show().find('ul').show();
				jQuery("#hot_MoveTab_"+nextNum).animate({left:'-='+thisWidth+'px'},100,function(){
					thisNum += 1;
					if(!isHover) {
						intervalIds = intervalIds + "," + setInterval("scrollright3("+lang+",1)",3000);
					}
					isMove = false;
					jQuery("#hot_page").html("(Page of "+nextNum+"/"+totleTabNum+")");
				});
			});
		}
	} else {
		clearAllTimeOut();
		totleTabNum = Math.ceil(lang/5);
		var thisWidth = jQuery("#hot_MoveTab_"+thisNum).width();
		jQuery("#hot_MoveTab_"+thisNum).hide();
		var nextNum = thisNum+1;
		if(nextNum>totleTabNum) {
			nextNum = 1;
			thisNum = 0;
		}
		jQuery("#hot_MoveTab_"+nextNum).css('left',0).show().find('ul').show();
		thisNum += 1;
		if(!isHover) {
			intervalIds = intervalIds + "," + setInterval("scrollright3("+lang+",1)",3000);
		}
		jQuery("#hot_page").html("(Page of "+nextNum+"/"+totleTabNum+")");
		//scrollright3(lang,borm);
	}
}

function scrollleft3(lang,borm){
	if(!isIE6) {
		if(!isMove) {
			isMove = true;
			clearAllTimeOut();
			totleTabNum = Math.ceil(lang/5);
			var thisWidth = jQuery("#hot_MoveTab_"+thisNum).width();
			jQuery("#hot_MoveTab_"+thisNum).animate({left:'+='+thisWidth+'px'},100,function(){
				jQuery(this).hide();
				var prevNum = thisNum-1;
				if(prevNum<=0) {
					prevNum = totleTabNum;
					thisNum = totleTabNum +1 ;
				}
				jQuery("#hot_MoveTab_"+prevNum).css('left','-'+thisWidth+'px').show().find('ul').show();
				jQuery("#hot_MoveTab_"+prevNum).animate({left:'+='+thisWidth+'px'},100,function(){
					thisNum -= 1;
					if(!isHover) {
						intervalIds = intervalIds + "," + setInterval("scrollright3("+lang+",1)",3000);
					}
					isMove = false;
					jQuery("#hot_page").html("(Page of "+prevNum+"/"+totleTabNum+")");
				});
			});
		}
	} else {
		clearAllTimeOut();
		totleTabNum = Math.ceil(lang/5);
		var thisWidth = jQuery("#hot_MoveTab_"+thisNum).width();
		jQuery("#hot_MoveTab_"+thisNum).hide();
		var prevNum = thisNum-1;
		if(prevNum<=0) {
			prevNum = totleTabNum;
			thisNum = totleTabNum +1 ;
		}
		jQuery("#hot_MoveTab_"+prevNum).css('left',0).show().find('ul').show();
		thisNum -= 1;
		if(!isHover) {
			intervalIds = intervalIds + "," + setInterval("scrollright3("+lang+",1)",3000);
		}
		jQuery("#hot_page").html("(Page of "+prevNum+"/"+totleTabNum+")");
		//scrollleft3(lang,borm);
	}
}


function dbClickEvent(){};

function clearAllTimeOut(){
	var intervalId = intervalIds.split(",");
	for(var i=0; i<intervalId.length;i++) {
		clearInterval(intervalId[i]);
	}
}


function checkshow(num){
	/*rm11 = document.getElementById("mb1_1");
	rm12 = document.getElementById("mb1_2");
	rm13 = document.getElementById("mb1_3");
	if(document.getElementById("mb2_1")){
		rm21 = document.getElementById("mb2_1");
		rm22 = document.getElementById("mb2_2");
		rm23 = document.getElementById("mb2_3");
	}*/
	if(num == 0){
		/*
		rm21.className = 'bt_sp_pt_tited1';
		rm22.className = 'bt_sp_pt_tited3 tit14b';
		rm23.className = 'bt_sp_pt_tited2';
		rm11.className = 'bt_sp_pt_tit1';	
		rm12.className = 'bt_sp_pt_tit3 tit14b';	
		rm13.className = 'bt_sp_pt_tit2';*/
		document.getElementById("Might").className = '';
		document.getElementById("Bought").className = 'bt_sp_cle_active';
		document.getElementById("Related").style.display="";
		document.getElementById("Mightlike").style.display="none";
	}else if(num == 1){
		/*rm11.className = 'bt_sp_pt_tited1';
		rm12.className = 'bt_sp_pt_tited3 tit14b';
		rm13.className = 'bt_sp_pt_tited2';
		if(rm21){
			rm21.className = 'bt_sp_pt_tit1';	
			rm22.className = 'bt_sp_pt_tit3 tit14b';	
			rm23.className = 'bt_sp_pt_tit2';	
		}*/
		document.getElementById("Might").className = 'bt_sp_cle_active';
		document.getElementById("Bought").className = '';
		document.getElementById("Related").style.display="none";
		document.getElementById("Mightlike").style.display="";
	}
}

function facebookmessage(urlpath,skuid,tempProductID,tempProductPrice,Discount_int,showtype,curcurrency,DollarName,Symbol,IsDiscountLoss5,IsDiscount){
	/*var result = shareUrl(urlpath);
	if(result){*/
		/*if(IsDiscountLoss5==1 && ReadCookie("IDINORSTATS")!=1){
			if(curcurrency == 'JPY'){
				priceshow_value = DollarName+Symbol;
				priceshow_value1 = DollarName+Symbol+" <span id='productcurprice'> "+tofloatjpy(tempProductPrice*0.75);
				Discountpriceshow_value=priceshow_value1;
			}else{        
				priceshow_value = DollarName+Symbol;
				priceshow_value1 = DollarName+Symbol+"  <span id='productcurprice'>  "+tofloat(tempProductPrice*0.75,2);
				Discountpriceshow_value=priceshow_value1;
			}
			if(curcurrency == 'JPY'){
				hdispriceshow_value = DollarName+Symbol+" "+tofloatjpy(tempProductPrice*0.5);
			}else{        
				hdispriceshow_value = DollarName+Symbol+" "+tofloat(tempProductPrice*0.5,2);
			}
			if(showtype == 1){
				Grid = "";
				Grid +='<div class="s_price_login"><div class="s_price_login_5"><span><strong>Select Currency:</strong></span><div class="newright_pro_sub_k_bg"  onclick="showCurrency2(1,25)" onmouseout="closecurdiv2()" id="productcurprice"><span id="imgshow2"><a href="javascript:void(0);" onclick="return false;">'+priceshow_value+'</a></span></div><div class="autoHeight"></div></div><div class="s_price_login_6"><strong>My Price:</strong><span>'+Discountpriceshow_value+'</span></div><div class="s_price_login_3 s_price_bn"><strong>iDinor Price:</strong> <span><strong>'+hdispriceshow_value+'</strong></span><br /> <strong>(50%off)</strong></div><div class="s_price_login_4"><a href="http://www.dinodirect.com/html/idinor.html?returnurl='+location.href+'">Join iDinor and get 50% off <br />right now</a></div><div class="autoHeight"></div></div>'; 
				document.getElementById(tempProductID).innerHTML=Grid;
				document.getElementById("facebookname").innerHTML="Shared on facebook";
			}
		}else if(IsDiscountLoss5==1 && ReadCookie("IDINORSTATS")==1){
				document.getElementById("facebookname").innerHTML="Shared on facebook";
		}*/
		affid = 0;
		urlpath='http://www.facebook.com/sharer.php?u='+urlpath+'.html';
		if(ReadCookie("AFFILIATELINKID") != "" && ReadCookie("AFFILIATELINKID") != 0){
			urlpath=urlpath+'?FBffid='+ReadCookie("AFFILIATELINKID");
			affid = ReadCookie("AFFILIATELINKID");
		}
	 postData = "";
		postData = postData + "urlpath="+urlpath+"&skuid="+skuid+"&affid="+affid+"&pcuid="+ReadCookie("_dino_s_pcuid");
		$.ajax({
		  type:'post',
		  url:jsMainSiteUrl+'facebookmessage.cfm',
		  data:postData,
		  success:function(result){
			  
		  }
		});	
	/*}*/window.open(urlpath);
	return false;
}

function getproductprice(tempProductID,tempProductPrice,halfPriceOri,thrPriceOri,Discount_int,showtype,curcurrency,DollarName,Symbol,IsDiscountLoss5,IsDiscount,skuid,temp,isfreeshipping,freeGiftFlag,isIdinorProduct,tempProductIdNumber){
	var isFreeGift = false;
	if(typeof freeGiftFlag != 'undefined' && freeGiftFlag == 1) {
		isFreeGift = true;
	}
	if(document.getElementById(tempProductID)){
	}else{
		return;
	}
	priceshow_value = DollarName+Symbol;
	priceshow_value1 = DollarName+Symbol+tempProductPrice;
	if(curcurrency == 'JPY' || curcurrency == 'IDR' || curcurrency == 'RUB'){
		priceshow=tempProductPrice;
	}else{
		priceshow=tempProductPrice.toFixed(2);
	}
	
	var linkmsg='';
	var linkmsg2='';
	if(ReadCookie("IDINORSTATS")==1){
		if(ReadCookie("ISIDINOBUYFO")==1){
			linkmsg = '';
			linkmsg2 = '';
		}else{
			linkmsg = '<div class="bt_sp_islr11"><a href="http://www.dinodirect.com/html/idinor.html?returnurl='+location.href+'" target="_blank">You can get extra 5% off for the iDinor first order</a></div>';
			linkmsg2 = '<div class="bt_sp_islr11"><a href="http://www.dinodirect.com/html/idinor.html?returnurl='+location.href+'" target="_blank">You can get extra 5% off for the iDinor first order</a></div>';
		}
	}else{
		linkmsg = '<div class="bt_sp_islr11">Save extra <span class="red tit14b">$xxx</span> by joining iDinor VIP member, <a href="http://www.dinodirect.com/html/idinor.html?returnurl='+location.href+'" target="_blank">view details</a> or <a href="javascript:void(0);" onclick=\'ComDlg.dlg.show("JoinidinorVIPClub"); initloginstat(); return false;\'>join now</a>! </div>';
		linkmsg2 = '<div class="bt_sp_islr11">Save extra <span class="red tit14b">$xxx</span> by joining iDinor VIP member, <a href="http://www.dinodirect.com/html/idinor.html?returnurl='+location.href+'" target="_blank">view details</a> or <a href="javascript:void(0);" onclick=\'ComDlg.dlg.show("JoinidinorVIPClub"); initloginstat(); return false;\'>join now</a>!</div>';
		if(isIdinorProduct ==1){ // idinor 促销
			linkmsg = '<div class="bt_sp_islr11">iDinor VIP Price Free Trial Only on August 12 - August 18. Wanna get more privileges? <a href="http://www.dinodirect.com/html/idinor.html?returnurl='+location.href+'" target="_blank" style="text-decoration: underline;">To be iDinor VIP member Now &gt;&gt;</a></div>';
			linkmsg2 = linkmsg;
		}
	}
	if(isIdinorProduct !=1){ // idinor 促销
		linkmsg = '<div class="bt_sp_islr6" id="dailydeal_time_mc"></div>'+linkmsg;
		linkmsg2 = '<div class="bt_sp_islr6" id="dailydeal_time_mc"></div>'+linkmsg2;
	}
	
	Discountpriceshow_value=priceshow_value1;
	// if the product allow discount
	if(IsDiscountLoss5==0){
		if(curcurrency == 'JPY' || curcurrency == 'IDR' || curcurrency == 'RUB'){
			umLosspriceshow_value = halfPriceOri;
			extraprice = (halfPriceOri*0.05).toFixed(0);
		}else{
			umLosspriceshow_value = halfPriceOri.toFixed(2);
			extraprice = (halfPriceOri*0.05).toFixed(2);
		}
		
		Grid = "";
		DisStr = "";
		
		var wantBuyText = '<style type="text/css">.newText a{color:#0066CC;text-decoration:none;}</style>&nbsp; <span style="font-size:12px;color:#333333" class="newText">Want to buy more types of Chinese Knots? Please <a '
		+ ' target="_blank" href="http://www.dinodirect.com/se-chinese-knot">click here>></a></span>';
		
		if(IsDiscount==1 && Discount_int>0){
			Grid +='<div class="bt_sp_islr6" id="div_op_price">';
			if(curcurrency == 'RUB'){
				
				Grid +='<div class="bt_sp_islr7 tit12b">Original Price:</div>';
				Grid +='<div class="bt_sp_islr9 tit14b gray"><span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span>&nbsp;'+priceshow_value+'<span id="productoldprice2" style="display:none;">'+priceshow+'</span></div>';
			}else{
				Grid +='<div class="bt_sp_islr7 tit12b">Original Price:</div>';
				Grid +='<div class="bt_sp_islr9 tit14b gray">'+priceshow_value+'&nbsp;<span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span><span id="productoldprice2" style="display:none;">'+priceshow+'</span></div>';
			}
			Grid +='	<div class="autoHeight"></div>';
			Grid +='</div>';
			DisStr='<br />('+(100-Discount_int)+'% OFF)';
		}else{
			Grid +='<span id="productoldprice" style="display:none;"></span><span id="productoldprice2" style="display:none;"></span>';
		}
		if(!isFreeGift) {
			Grid +='<div class="bt_sp_islr6">';
			if(isIdinorProduct == 1){// idinor促销活动产品
				Grid +='	<div class="bt_sp_islr7 sp_3p bt_sp_islrSpd  tit12 red">iDinor VIP Price:'+DisStr+'</div>'
			}else{
				Grid +='	<div class="bt_sp_islr7 tit16b red">Price:'+DisStr+'</div>';
			}
			extrapricemsg = '';
			if(curcurrency == 'RUB'){
				Grid +='<div class="bt_sp_islr8 tit40b red"><span id="productcurprice" >'+getCurShow(curcurrency,DollarName+Symbol,umLosspriceshow_value,1)+'</span>&nbsp;'+priceshow_value;
				extrapricemsg += '<span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span> '+priceshow_value;
			}else{
				Grid +='<div class="bt_sp_islr8 tit40b red">'+priceshow_value+'&nbsp;<span id="productcurprice" >'+getCurShow(curcurrency,DollarName+Symbol,umLosspriceshow_value,1)+'</span>';
				extrapricemsg += priceshow_value+' <span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span>';
			}
			extrapricemsg += '<span id="extraproductprice2" style="display:none">'+extraprice+'</span>';
			Grid +='	<span  id="productcurprice2" style="display:none">'+umLosspriceshow_value+'</span></div>';
			Grid +='<div class="bt_sp_islr10 tit12b white" id="dailydeal_time" style="display:none;"></div>';
			if(isIdinorProduct == 1){
			Grid +='<div class="bt_sp_islr10_idinor white tit14b" id="dailydeal_time_mc"></div>';
			}
			Grid +='<div class="autoHeight"></div>';                  
			Grid +='</div>';
			linkmsg2 = linkmsg2.replace("$xxx",extrapricemsg);
			Grid +=linkmsg2;
		} else {
			Grid += '<div class="bt_sp_islr6"><div class="bt_sp_islr8 tit30b red">Not For Sale '+wantBuyText+'</div><div class="autoHeight"></div></div>';
			Grid += '<div class="bt_sp_islr6"> This is the Free Gift which will be added to your order automatically. Not for sale <a href="http://www.dinodirect.com/FreeGift/" target="_blank">Learn More&gt;&gt;</a><div class="autoHeight"></div></div>';
		}
		document.getElementById(tempProductID).innerHTML=Grid;
	}else{
	if(ReadCookie("IDINORSTATS")==1){
		if(curcurrency == 'JPY' || curcurrency == 'IDR' || curcurrency == 'RUB'){
			hdispriceshow_value = halfPriceOri;
			extraprice = (halfPriceOri*0.05).toFixed(0);
		}else{
			hdispriceshow_value = halfPriceOri.toFixed(2);
			extraprice = (halfPriceOri*0.05).toFixed(2);
		}
		diff = tempProductPrice-hdispriceshow_value;
		if(curcurrency == 'JPY' || curcurrency == 'IDR' || curcurrency == 'RUB'){
			diffpriceshow_value = getCurShow(curcurrency,DollarName+Symbol,diff);
			/*
			if(ReadCookie("ISIDINOBUYFO")==0)
			{
				hdispriceshow_value = thrPriceOri;
				diffpriceshow_value = getCurShow(curcurrency,DollarName+Symbol,(tempProductPrice-thrPriceOri));
			}
			*/
		}else{
			diffpriceshow_value = getCurShow(curcurrency,DollarName+Symbol,diff.toFixed(2));
			/*
			if(ReadCookie("ISIDINOBUYFO")==0)
			{
				hdispriceshow_value = thrPriceOri.toFixed(2);
				diffpriceshow_value = getCurShow(curcurrency,DollarName+Symbol,(tempProductPrice-thrPriceOri).toFixed(2));
			}
			*/
		}
		disprotion = ' (50% off)';
		/*
		if(ReadCookie("ISIDINOBUYFO")==0)
		{
			disprotion = ' (61% off)';
		}
		*/
		postData = "FTextUserPwd2="+parseInt(Math.random()*1000000);
		postData = postData + "&skuid="+skuid+"&pcuid="+ReadCookie("_dino_s_pcuid");
		$.ajax({
		  type:'post',
		  url:jsMainSiteUrl+'AjaxIdinorseven.cfm',
		  data:postData,
		  error:function(XMLHttpRequest, textStatus, errorThrown){
								AlertInfoAdd("Product Get Price AJAX Error."+textStatus+"-"+errorThrown,27,skuid);
							},
		  success:function(result){
				if(result == 0){
					if(showtype == 1){
						Grid = '<div class="bt_sp_islr6" id="div_op_price">';
						Grid +='	<div class="bt_sp_islr7 tit12b">Original Price:</div>';
						if(curcurrency == 'RUB'){
							Grid +='<div class="bt_sp_islr9 tit14b gray"><span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span>&nbsp;'+priceshow_value+'</div>';
						}else{
							Grid +='<div class="bt_sp_islr9 tit14b gray">'+priceshow_value+'&nbsp;<span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span></div>';
						}
						Grid +='	<span id="productoldprice2" style="display:none">'+priceshow+'</span>';
						Grid +='	<div class="autoHeight"></div>';
						Grid +='</div>';
						if(!isFreeGift) {
							Grid +='<div class="bt_sp_islr6">';
							Grid +='	<div class="bt_sp_islr7 tit12b red">My Price:</div>';
							Grid +='	<div class="bt_sp_islr8 tit30b red">';
							extrapricemsg = '';
							if(curcurrency == 'RUB'){
								Grid +='<span id="productcurprice">'+getCurShow(curcurrency,DollarName+Symbol,hdispriceshow_value,1)+'</span><span>&nbsp;'+priceshow_value+'</span>';
								extrapricemsg += '<span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span> '+priceshow_value;
							}else{
								Grid +='<span>'+priceshow_value+'&nbsp;</span><span id="productcurprice">'+getCurShow(curcurrency,DollarName+Symbol,hdispriceshow_value,1)+'</span>';
								extrapricemsg += priceshow_value+' <span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span>';
							}	
							extrapricemsg += '<span id="extraproductprice2" style="display:none">'+extraprice+'</span>';
							Grid +='	<span id="productcurprice2" style="display:none">'+hdispriceshow_value+'</span>';
							Grid +='	</div>';
							Grid +='	<div class="bt_sp_islr10 tit12b white" id="dailydeal_time" style="display:none;"></div>';
							Grid +='	<div class="autoHeight"></div>';
							Grid +='</div>';
							linkmsg = linkmsg.replace("$xxx",extrapricemsg);
							Grid +=linkmsg;
						} else {
							Grid += '<div class="bt_sp_islr6"><div class="bt_sp_islr8 tit30b red">Not For Sale '+wantBuyText+'</div><div class="autoHeight"></div></div>';
							Grid += '<div class="bt_sp_islr6"> This is the Free Gift which will be added to your order automatically. Not for sale <a href="http://www.dinodirect.com/FreeGift/" target="_blank">Learn More&gt;&gt;</a><div class="autoHeight"></div></div>';
						}
						document.getElementById(tempProductID).innerHTML=Grid;
					}
				}else{
					if(showtype == 1){
						Grid = '<div class="bt_sp_islr6" id="div_op_price">';
						Grid +='	<div class="bt_sp_islr7 tit12b">Original Price:</div>';
						Grid +='	<div class="bt_sp_islr9 tit14b gray">';
						if(curcurrency == 'RUB'){
							Grid +='<span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span>&nbsp;'+priceshow_value+'';
						}else{
							Grid +=''+priceshow_value+'&nbsp;<span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span>';
						}
						Grid +='	<span id="productoldprice2" style="display:none">'+priceshow+'</span>';
						Grid +='	</div>';
						Grid +='	<div class="autoHeight"></div>';
						Grid +='</div>';
						if(!isFreeGift) {
							Grid +='<div class="bt_sp_islr6">';
							Grid +='	<div class="bt_sp_islr7 tit12b red">My Price:</div>';
							Grid +='	<div class="bt_sp_islr8 tit30b red">';
							extrapricemsg = '';
							if(curcurrency == 'RUB'){
								Grid +='<span id="productcurprice">'+getCurShow(curcurrency,DollarName+Symbol,hdispriceshow_value,1)+'</span>&nbsp;'+priceshow_value+'';
								extrapricemsg += '<span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span> '+priceshow_value;
							}else{
								Grid +=priceshow_value+'&nbsp;<span id="productcurprice">'+getCurShow(curcurrency,DollarName+Symbol,hdispriceshow_value,1)+'</span>';
								extrapricemsg += priceshow_value+' <span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span>';
							}
							extrapricemsg += '<span id="extraproductprice2" style="display:none">'+extraprice+'</span>';
							Grid +='	<span id="productcurprice2" style="display:none">'+hdispriceshow_value+'</span>';
							Grid +='	</div>';
							Grid +='	<div class="bt_sp_islr10 tit12b white" id="dailydeal_time" style="display:none;"></div>';
							Grid +='	<div class="autoHeight"></div>';
							Grid +='</div>';
							linkmsg = linkmsg.replace("$xxx",extrapricemsg);
							Grid +=linkmsg; 
						} else {
							Grid += '<div class="bt_sp_islr6"><div class="bt_sp_islr8 tit30b red">Not For Sale '+wantBuyText+'</div><div class="autoHeight"></div></div>';
							Grid += '<div class="bt_sp_islr6"> This is the Free Gift which will be added to your order automatically. Not for sale <a href="http://www.dinodirect.com/FreeGift/" target="_blank">Learn More&gt;&gt;</a><div class="autoHeight"></div></div>';
						}
						document.getElementById(tempProductID).innerHTML=Grid;
					}
				}
		  }
		});			
	}else{    
		if(curcurrency == 'JPY' || curcurrency == 'IDR' || curcurrency == 'RUB'){
			hdispriceshow_value = halfPriceOri;
			extraprice = (halfPriceOri*0.05).toFixed(0);
		}else{
			hdispriceshow_value = halfPriceOri.toFixed(2);
			extraprice = (halfPriceOri*0.05).toFixed(2);
		}
		postData = "FTextUserPwd2="+parseInt(Math.random()*1000000);
		postData = postData + "&skuid="+skuid+"&pcuid="+ReadCookie("_dino_s_pcuid");
		$.ajax({
		  type:'post',
		  url:jsMainSiteUrl+'AjaxIdinorseven.cfm',
		  data:postData,
		  error:function(XMLHttpRequest, textStatus, errorThrown){
								AlertInfoAdd("Product Get Price AJAX Error."+textStatus+"-"+errorThrown,27,skuid);
							},
		  success:function(result){
				if(result == 0){
					if(showtype == 1){
						Grid = "";
						if(skuid == 'A1217000DE' || skuid == 'A25760000L' || skuid == 'A30020000F' || skuid == 'A25680000Z' || skuid == 'A1330000HJ' || skuid == 'A01520000M'){
							Grid = '<div class="bt_sp_islr6" id="div_op_price">';
							Grid +='	<div class="bt_sp_islr7 tit12b">Original Price:</div>';
							Grid +='	<div class="bt_sp_islr9 tit14b gray">';
							if(curcurrency == 'RUB'){
								Grid +='<span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span>&nbsp;'+priceshow_value;
							}else{
								Grid +=priceshow_value+'&nbsp;<span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span>';
							}
							Grid +='	<span id="productoldprice2" style="display:none">'+priceshow+'</span>';
							Grid +='	</div>';
							Grid +='	<div class="autoHeight"></div>';
							Grid +='</div>';
							if(!isFreeGift) {
								Grid +='<div class="bt_sp_islr6">';
								Grid +='	<div class="bt_sp_islr7 tit12b red">Today\'s Price:</div>';
								Grid +='	<div class="bt_sp_islr8 tit30b red">';
								extrapricemsg = '';
								if(curcurrency == 'RUB'){
									Grid +='<span id="productcurprice">'+getCurShow(curcurrency,DollarName+Symbol,hdispriceshow_value,1)+'</span>&nbsp;'+priceshow_value;
									extrapricemsg += '<span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span> '+priceshow_value;
								}else{
									Grid +=priceshow_value+'&nbsp;<span id="productcurprice">'+getCurShow(curcurrency,DollarName+Symbol,hdispriceshow_value,1)+'</span>';
									extrapricemsg += priceshow_value+' <span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span>';
								}
								extrapricemsg += '<span id="extraproductprice2" style="display:none">'+extraprice+'</span>';
								Grid +='	<span id="productcurprice2" style="display:none">'+hdispriceshow_value+'</span>';
								Grid +='	</div>';
								Grid +='	<div class="bt_sp_islr10 tit12b white" id="dailydeal_time" style="display:none;"></div>';
								Grid +='	<div class="autoHeight"></div>';
								Grid +='</div>';
								linkmsg = linkmsg.replace("$xxx",extrapricemsg);
								Grid +=linkmsg; 
							} else {
								Grid += '<div class="bt_sp_islr6"><div class="bt_sp_islr8 tit30b red">Not For Sale '+wantBuyText+'</div><div class="autoHeight"></div></div>';
								Grid += '<div class="bt_sp_islr6"> This is the Free Gift which will be added to your order automatically. Not for sale <a href="http://www.dinodirect.com/FreeGift/" target="_blank">Learn More&gt;&gt;</a><div class="autoHeight"></div></div>';
							}
						}else{
							if(temp == 5){
								if(isfreeshipping == 1){
									freesh = '<img src="/Templates/Site61/Dino/images/time_over2.gif" width="34" height="30" align="absmiddle" /><a href="http://www.dinodirect.com/Help/FAQTypeID-2-FAQID-7.html"><img src="/Templates/Site61/Dino/images/time_over3.gif" align="absmiddle" /></a>';
								}else{
									freesh = "";
								}
								Grid = '<div class="bt_sp_islr6" id="div_op_price">';
								Grid +='	<div class="bt_sp_islr7 tit12b">Original Price:</div>';
								Grid +='	<div class="bt_sp_islr9 tit14b gray">';
								if(curcurrency == 'RUB'){
									Grid +=' <span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span>&nbsp;'+priceshow_value;
								}else{
									Grid +=priceshow_value+'&nbsp;<span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span>';
								}
								Grid +='	<span id="productoldprice2" style="display:none;">'+priceshow+'</span>';
								Grid +='	</div>';
								Grid +='	<div class="autoHeight"></div>';
								Grid +='</div>';
								if(!ifFreeGift) {
									Grid +='<div class="bt_sp_islr6">';
									Grid +='	<div class="bt_sp_islr7 tit12b red">My Price:<br>(50% OFF)</div>';
									Grid +='	<div class="bt_sp_islr8 tit30b red">';
									extrapricemsg = '';
									if(curcurrency == 'RUB'){
										Grid +='<span id="productcurprice" class="time_over_tt2_01_p2">'+getCurShow(curcurrency,DollarName+Symbol,hdispriceshow_value,1)+'</span>&nbsp;'+priceshow_value;
										extrapricemsg += '<span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span> '+priceshow_value;
									}else{
										Grid +=priceshow_value+'&nbsp;<span id="productcurprice" class="time_over_tt2_01_p2">'+getCurShow(curcurrency,DollarName+Symbol,hdispriceshow_value,1)+'</span>';
										extrapricemsg += priceshow_value+' <span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span>';
									}
									extrapricemsg += '<span id="extraproductprice2" style="display:none">'+extraprice+'</span>';
									Grid +='	<span id="productcurprice2"  style="display:none"'+hdispriceshow_value+'</span>';
									Grid +='	</div>';
									Grid +='	<div class="bt_sp_islr10 tit12b white" id="dailydeal_time" style="display:none;"></div>';
									Grid +='	<div class="autoHeight"></div>';
									Grid +='</div>';
									linkmsg2 = linkmsg2.replace("$xxx",extrapricemsg);
									Grid +=freesh+linkmsg2; 
								} else {
									Grid += '<div class="bt_sp_islr6"><div class="bt_sp_islr8 tit30b red">Not For Sale '+wantBuyText+'</div><div class="autoHeight"></div></div>';
									Grid += '<div class="bt_sp_islr6"> This is the Free Gift which will be added to your order automatically. Not for sale <a href="http://www.dinodirect.com/FreeGift/" target="_blank">Learn More&gt;&gt;</a><div class="autoHeight"></div></div>';
								}
							}else{
								Grid = '<div class="bt_sp_islr6" id="div_op_price">';
								Grid +='	<div class="bt_sp_islr7 tit12b">Original Price:</div>';
								Grid +='	<div class="bt_sp_islr9 tit14b gray">';
								if(curcurrency == 'RUB'){
									Grid +='<span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span>&nbsp;'+priceshow_value;
								}else{
									Grid +=priceshow_value+'&nbsp;<span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span>';
								}
								Grid +='	<span id="productoldprice2" style="display:none;">'+priceshow+'</span>';
								Grid +='	</div>';
								Grid +='	<div class="autoHeight"></div>';
								Grid +='</div>';
								if(!isFreeGift) {
									Grid +='<div class="bt_sp_islr6">';
									Grid +='	<div class="bt_sp_islr7 tit12b red">My Price:<br>(50% OFF)</div>';
									Grid +='	<div class="bt_sp_islr8 tit30b red">';
									extrapricemsg = '';
									if(curcurrency == 'RUB'){
										Grid +='<span id="productcurprice" >'+getCurShow(curcurrency,DollarName+Symbol,hdispriceshow_value,1)+'</span>&nbsp;'+priceshow_value;
										extrapricemsg += '<span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span> '+priceshow_value;
									}else{
										Grid +=priceshow_value+'&nbsp;<span id="productcurprice" >'+getCurShow(curcurrency,DollarName+Symbol,hdispriceshow_value,1)+'</span>';
										extrapricemsg += priceshow_value+' <span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span>';
									}
									extrapricemsg += '<span id="extraproductprice2" style="display:none">'+extraprice+'</span>';
									Grid +='	<span  id="productcurprice2" style="display:none">'+hdispriceshow_value+'</span>';
									Grid +='	</div>';
									Grid +='	<div class="bt_sp_islr10 tit12b white" id="dailydeal_time" style="display:none;"></div>';
									Grid +='	<div class="autoHeight"></div>';
									Grid +='</div>';
									linkmsg2 = linkmsg2.replace("$xxx",extrapricemsg);
									Grid +=linkmsg2; 
								} else {
									Grid += '<div class="bt_sp_islr6"><div class="bt_sp_islr8 tit30b red">Not For Sale '+wantBuyText+'</div><div class="autoHeight"></div></div>';
									Grid += '<div class="bt_sp_islr6"> This is the Free Gift which will be added to your order automatically. Not for sale <a href="http://www.dinodirect.com/FreeGift/" target="_blank">Learn More&gt;&gt;</a><div class="autoHeight"></div></div>';
								}
							}
						}
						document.getElementById(tempProductID).innerHTML=Grid;
					}
				}else{
					if(curcurrency == 'JPY'){
						priceshow_value = DollarName+Symbol;
						priceshow_value1 = DollarName+Symbol+" <span id='productcurprice'> "+tofloatjpy(tempProductPrice*0.75);
						Discountpriceshow_value=priceshow_value1;
					}else if(curcurrency == 'IDR' || curcurrency == 'BRL'){
						priceshow_value = DollarName+Symbol;
						priceshow_value1 = DollarName+Symbol+" <span id='productcurprice'> "+tofloatidr(tempProductPrice*0.75);
						Discountpriceshow_value=priceshow_value1;
					}else{        
						priceshow_value = DollarName+Symbol;
						priceshow_value1 = DollarName+Symbol+"  <span id='productcurprice'>  "+tofloat(tempProductPrice*0.75,2);
						Discountpriceshow_value=priceshow_value1;
					}
					if(showtype == 1){
						Grid = "";
						if(skuid == 'A1217000DE' || skuid == 'A25760000L' || skuid == 'A30020000F' || skuid == 'A25680000Z' || skuid == 'A1330000HJ' || skuid == 'A01520000M'){
							Grid = '<div class="bt_sp_islr6" id="div_op_price">';
							Grid +='	<div class="bt_sp_islr7 tit12b">Original Price:</div>';
							Grid +='	<div class="bt_sp_islr9 tit14b gray">';
							if(curcurrency == 'RUB'){
								Grid +='<span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span>&nbsp;'+priceshow_value;
							}else{
								Grid +=priceshow_value+'&nbsp;<span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span>';
							}
							Grid +='	<span id="productoldprice2" style="display:none">'+priceshow+'</span>';
							Grid +='	</div>';
							Grid +='	<div class="autoHeight"></div>';
							Grid +='</div>';
							if(!isFreeGift) {
								Grid +='<div class="bt_sp_islr6">';
								Grid +='	<div class="bt_sp_islr7 tit12b red">Today\'s Price:</div>';
								Grid +='	<div class="bt_sp_islr8 tit30b red">';
								extrapricemsg = '';
								if(curcurrency == 'RUB'){
									Grid +='<span id="productcurprice">'+getCurShow(curcurrency,DollarName+Symbol,hdispriceshow_value,1)+'</span>&nbsp;'+priceshow_value; 
									extrapricemsg += '<span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span> '+priceshow_value;
								}else{
									Grid +=priceshow_value+'&nbsp;<span id="productcurprice">'+getCurShow(curcurrency,DollarName+Symbol,hdispriceshow_value,1); 
									extrapricemsg += priceshow_value+' <span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span>';
								}
								extrapricemsg += '<span id="extraproductprice2" style="display:none">'+extraprice+'</span>';
								Grid +='	<span id="productcurprice2" style="display:none">'+hdispriceshow_value+'</span>';
								Grid +='	</div>';
								Grid +='	<div class="bt_sp_islr10 tit12b white" id="dailydeal_time" style="display:none;"></div>';
								Grid +='	<div class="autoHeight"></div>';
								Grid +='</div>';
								linkmsg = linkmsg.replace("$xxx",extrapricemsg);
								Grid +=linkmsg; 
							} else {
								Grid += '<div class="bt_sp_islr6"><div class="bt_sp_islr8 tit30b red">Not For Sale '+wantBuyText+'</div><div class="autoHeight"></div></div>';
								Grid += '<div class="bt_sp_islr6"> This is the Free Gift which will be added to your order automatically. Not for sale <a href="http://www.dinodirect.com/FreeGift/" target="_blank">Learn More&gt;&gt;</a><div class="autoHeight"></div></div>';
							}
						}else{	
							Grid = '<div class="bt_sp_islr6" id="div_op_price">';
							Grid +='	<div class="bt_sp_islr7 tit12b">Original Price:</div>';
							Grid +='	<div class="bt_sp_islr9 tit14b gray">';
							if(curcurrency == 'RUB'){
            					Grid +='<span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span>&nbsp;'+priceshow_value;
							}else{
								Grid +=priceshow_value+'&nbsp;<span id="productoldprice">'+getCurShow(curcurrency,DollarName+Symbol,priceshow,1)+'</span>';
							}
							Grid +='	<span id="productoldprice2" style="display:none;">'+priceshow+'</span>';
							Grid +='	</div>';
							Grid +='	<div class="autoHeight"></div>';
							Grid +='</div>';
							if(!isFreeGift) {
								Grid +='<div class="bt_sp_islr6">';
								Grid +='	<div class="bt_sp_islr7 tit12b red">My Price:<br />(50% OFF)</div>';
								Grid +='	<div class="bt_sp_islr8 tit30b red">';
								extrapricemsg = '';
								if(curcurrency == 'RUB'){
									Grid +='<span id="productcurprice" >'+getCurShow(curcurrency,DollarName+Symbol,hdispriceshow_value,1)+'</span>&nbsp;'+priceshow_value;
									extrapricemsg += '<span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span> '+priceshow_value;
								}else{
									Grid +=priceshow_value+'&nbsp;<span id="productcurprice" >'+getCurShow(curcurrency,DollarName+Symbol,hdispriceshow_value,1)+'</span>';
									extrapricemsg += priceshow_value+' <span id="extraproductprice" >'+getCurShow(curcurrency,DollarName+Symbol,extraprice,1)+'</span>';
								}
								extrapricemsg += '<span id="extraproductprice2" style="display:none">'+extraprice+'</span>';
								Grid +='	<span  id="productcurprice2" style="display:none">'+hdispriceshow_value+'</span>';
								Grid +='	</div>';
								Grid +='	<div class="bt_sp_islr10 tit12b white" id="dailydeal_time" style="display:none;"></div>';
								Grid +='	<div class="autoHeight"></div>';
								Grid +='</div>';
								linkmsg2 = linkmsg2.replace("$xxx",extrapricemsg);
								Grid +=linkmsg2; 
							} else {
								Grid += '<div class="bt_sp_islr6"><div class="bt_sp_islr8 tit30b red">Not For Sale '+wantBuyText+'</div><div class="autoHeight"></div></div>';
								Grid += '<div class="bt_sp_islr6"> This is the Free Gift which will be added to your order automatically. Not for sale <a href="http://www.dinodirect.com/FreeGift/" target="_blank">Learn More&gt;&gt;</a><div class="autoHeight"></div></div>';
							}
						}
						document.getElementById(tempProductID).innerHTML=Grid;
					}
				}
		  }
		});		
	}
	}
	
	try{
	if(document.getElementById("ddtime_MulteChoiec")){
		document.getElementById("dailydeal_time_mc").innerHTML = document.getElementById("ddtime_MulteChoiec").innerHTML;
		document.getElementById("ddtime_MulteChoiec").innerHTML = "";
	}else{
		if(document.getElementById("ddtime_Default")){
			document.getElementById("dailydeal_time_mc").style.display="";
			document.getElementById("dailydeal_time_mc").innerHTML = document.getElementById("ddtime_Default").innerHTML;
			document.getElementById("ddtime_Default").innerHTML = "";
		}else{
			document.getElementById("dailydeal_time_mc").style.display="none";
		}
	}
	} catch(e) {}
	
	// reset productprice
	try {
		if (typeof(tempProductIdNumber) != "undefinde" && isNumber(tempProductIdNumber)) {
			$.getJSON(priceUrl + "?callback=?",
					{
						pid:tempProductIdNumber
					},
					function (obj) {
					try {
						var oriPrice = parseFloat(obj.pp) * jsonRateObj[curcurrency].Rate;
						var newPrice = parseFloat(obj.dp) * jsonRateObj[curcurrency].Rate;
						var oriPriceStr = CurrencyShowNumber(curcurrency,oriPrice);
						var newPriceStr = CurrencyShowNumber(curcurrency,newPrice,1);
						var idinorExtPriceStr = CurrencyShowNumber(curcurrency,newPrice*0.05,1);
						
						if (document.getElementById("productoldprice")) {
							document.getElementById("productoldprice").innerHTML = oriPriceStr;
						}
						if (document.getElementById("productoldprice2")) {
							document.getElementById("productoldprice2").innerHTML = oriPriceStr;
						}
						if (document.getElementById("productcurprice")) {
							document.getElementById("productcurprice").innerHTML = newPriceStr;
						}
						if (document.getElementById("productcurprice2")) {
							document.getElementById("productcurprice2").innerHTML = newPriceStr;
						}
						if (document.getElementById("fPrice")) {
							document.getElementById("fPrice").value = newPriceStr;
						}
						if (document.getElementById("extraproductprice")) {
							document.getElementById("extraproductprice").innerHTML = idinorExtPriceStr;
						}
						if (document.getElementById("extraproductprice2")) {
							document.getElementById("extraproductprice2").innerHTML = idinorExtPriceStr;
						}
						
						if (document.getElementById("div_op_price") && obj.isDis < 1) {
							document.getElementById("div_op_price").style.display = "none";
						}
						
						var shipSymbol = document.getElementById("hiddenShipPirceSymobl").value;
						var shipPrice = document.getElementById("hiddenShipPirce").value;
						shipSymbol = shipSymbol.replace(new RegExp("0","gm"),"");
						shipSymbol = shipSymbol.replace(",","");
						var totalPrice = parseFloat(newPriceStr) + parseFloat(shipPrice);
						if(curcurrency == 'RUB'){
							var shipString = "<div class='f_L'>" + newPriceStr + shipSymbol + " x 1 + " + CurrencyShowNumber(curcurrency,shipPrice) + shipSymbol + "&nbsp;=&nbsp;"  + "</div>" + "<div class='tit14 red sinp_price_3'>&nbsp;" + CurrencyShowNumber(curcurrency,totalPrice) + shipSymbol + "</div>";
						}else{
							shipSymbol = shipSymbol.replace(".","");
							var shipString = "<div class='f_L'>" + shipSymbol + newPriceStr  + " x 1 + " + shipSymbol + CurrencyShowNumber(curcurrency,shipPrice) + "&nbsp;=&nbsp;"  + "</div>" + "<div class='tit14 red sinp_price_3'>&nbsp;" + shipSymbol + CurrencyShowNumber(curcurrency,totalPrice) + "</div>";
						}
						document.getElementById("shipAllMoney").innerHTML = shipString;
					}catch(err){} 
				});
		}
	}catch(err2){}
}

String.prototype.trim = function()
{
	return this.replace(/(^[\\s]*)|([\\s]*$)/g,"");
}

function getMsrpPrice(msrpid,isIdino,IsDiscount,Discout,price,DollarName,curcurrency){
	var dis = 1;
	if(isIdino==1){
		dis = 0.5;
	}else if(IsDiscount==1 && Discout > 0){
		dis = Discout/100;
	}
	var oldmsrpprice = 0;
	var newmsrpprice = 0;
	if(curcurrency == 'JPY'){
		oldmsrpprice = tofloatjpy(price);
		newmsrpprice=tofloatjpy(price*dis);
	}else if(curcurrency == 'IDR' || curcurrency == 'RUB'){
		oldmsrpprice = tofloatidr(price);
		newmsrpprice = tofloatidr(price*dis);
	}else{        
		oldmsrpprice = tofloat(price);
		newmsrpprice = tofloat(price*dis);
	}
	if(Discout==1){
		document.getElementById("msrpoldprice"+msrpid).style.display='none';
		document.getElementById("msrpprice"+msrpid).innerHTML=getCurShow(curcurrency,DollarName,newmsrpprice);
	}else{
		document.getElementById("msrpoldprice"+msrpid).style.display='';
		document.getElementById("msrpoldprice"+msrpid).innerHTML=getCurShow(curcurrency,DollarName,oldmsrpprice);
		document.getElementById("msrpprice"+msrpid).innerHTML=getCurShow(curcurrency,DollarName,newmsrpprice);
	}
}

function focusWDate(stat,WDate,DDate){
	WDate.style.color = "#000";
	if(stat==0&&WDate.value.trim()=="mm/dd/yyyy"){
		WDate.value = "";
		WDate.style.color = "#000";
	}else{
		if(WDate.value.trim()==""){
			WDate.value = " mm/dd/yyyy";
			WDate.style.color = "#CCC";
		}else{
			checkWDate(DDate);
		}
	}
}

//判断录入婚纱定制时间
function checkWDate(DDate){
	var WDate = document.getElementById('WDate');
	if(WDate){
		var SWDate = WDate.value.split('/');
		if(WDate.value.trim()=="mm/dd/yyyy")
		{
			document.getElementById('WDateError').innerHTML = 'Please enter the date.';
			return false;
		}
		if(SWDate.length!=3){
			document.getElementById('WDateError').innerHTML = 'Please enter the correct date(mm/dd/yyyy).';
		}else{
			if(isNaN(parseInt(SWDate[0],10))||isNaN(parseInt(SWDate[1],10))||isNaN(parseInt(SWDate[2],10))){
				document.getElementById('WDateError').innerHTML = 'Please enter the correct date(mm/dd/yyyy).';
			}else{
				var dateReg = /^(?:(?:(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(\/|-)(?:0?2\1(?:29)))|(?:(?:(?:1[6-9]|[2-9]\d)?\d{2})(\/|-)(?:(?:(?:0?[13578]|1[02])\2(?:31))|(?:(?:0?[1,3-9]|1[0-2])\2(29|30))|(?:(?:0?[1-9])|(?:1[0-2]))\2(?:0?[1-9]|1\d|2[0-8]))))$/;
				endDate = parseInt(SWDate[2],10)+"/"+parseInt(SWDate[0],10)+"/"+parseInt(SWDate[1],10);
				if(dateReg.test(endDate)){
					nowDate = document.getElementById('WNowDate').value;
					d1 = new Date(nowDate);
					d2 = new Date(endDate);
					var time = d2.getTime() - d1.getTime();
					var days = parseInt(time/(1000*60*60*24));
					if(days<DDate){
						document.getElementById('WDateError').innerHTML = 'You enter a period of time must be '+DDate+' days later.';
					}else{
						document.getElementById('WDateError').innerHTML = '';
						return true;
					}
				}else{
					document.getElementById('WDateError').innerHTML = 'Please enter the correct date(mm/dd/yyyy).';
				}
			}
		}
		return false;
	}else{
		return true;	
	}
}

function OneClickBuy(){
	jsCartCount = ReadCookie("CARTCOUNT");
	var UserPoint = ReadCookie("USERPOINT");
	var jsStrUserName = ReadCookie("USERNAME").split(" ")[0];
	if(jsStrUserName && jsStrUserName != ""){
		document.getElementById("ocLogin").style.display='';
		document.getElementById("ocunLogin").style.display='none';
	}else{
		document.getElementById("ocLogin").style.display='none';
		document.getElementById("ocunLogin").style.display='';
	}
}
function OneClickBuySubmit(subtype){
	if(subtype){
		if(subtype=='diycheckqty'){
			var bb = diycheckqty(1);
		}else if(subtype=='checkqtyCM'){
			var bb = checkqtyCM(1);
		}else{
			var bb = checkqty(subtype,1);
		}
	}else{
		var bb = checkqty(0,1);
	}
	if(bb){
		document.getElementById("BuyType").value=1;
		getClientInfo();
		SetCookie("ONECLICKREF",document.getElementById("OneClickRef").value,1);
		document.getElementById("proinfo").submit();
	}
}
function getClientInfo()
{
	var CTempNowDate=new Date();
	var CTempNowDateStr=CTempNowDate.getFullYear()+"-"+(CTempNowDate.getMonth()+1)+"-"+CTempNowDate.getDate()+" "+CTempNowDate.toTimeString();
	document.getElementById("ClienteleDateTime").value=CTempNowDateStr;
}

function linkLogin(){
	location.href=jsMainSiteUrl+"UserLogin/?cur="+headstrCurrency+"&returnUrl="+encodeURIComponent(window.location.href);
}

function setSelectLastPriceTogether(prowid){
	var strhobbycode = "";
	var HobbyAddPrice = new Array();
	var HobbyCountTotal = document.getElementById("HobbyCountTogether"+prowid).value;
	for (i = 1;i<=HobbyCountTotal;i++){
		HobbyAddPrice[i] = document.getElementById("HobbyNameTogether" + i + "_" + prowid).value;
		if(document.getElementById(HobbyAddPrice[i] + document.getElementById("HobbyTogether" + i + "_" + prowid).value)){
		HobbyAddPrice[i] = document.getElementById(HobbyAddPrice[i] + document.getElementById("HobbyTogether" + i + "_" + prowid).value).innerHTML;
		}
	}
	if(prowid==1){
		HobbyCode2Together = HobbyCode2_Together1;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together1;
	}else if(prowid==2){
		HobbyCode2Together = HobbyCode2_Together2;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together2;
	}else if(prowid==3){
		HobbyCode2Together = HobbyCode2_Together3;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together3;
	}else if(prowid==4){
		HobbyCode2Together = HobbyCode2_Together4;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together4;
	}else if(prowid==5){
		HobbyCode2Together = HobbyCode2_Together5;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together5;
	}else if(prowid==6){
		HobbyCode2Together = HobbyCode2_Together6;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together6;
	}else if(prowid==7){
		HobbyCode2Together = HobbyCode2_Together7;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together7;
	}else if(prowid==8){
		HobbyCode2Together = HobbyCode2_Together8;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together8;
	}
	for (i=1;i<=HobbyCountTotal;i++){
		ID = "HobbyNameTogether" + i + "_" + prowid;
		ID = String(document.getElementById(ID).value);
		var AddToSelect = 0;
		var obj2 = document.getElementById("HobbyTogether" + i + "_" + prowid);
		for(ii=0;ii<obj2.length;ii++){
			var sAddPriceCode = "";
			AddToSelect = 0;
			for(iii=0;iii<HobbyCode2Together.length;iii++){
				if (document.getElementById(ID + obj2[ii].value + "_Together" + prowid).innerHTML == HobbyCode2Together[iii].code) {
					if(HobbyFloatPriceTogether[HobbyCode2Together[iii].codelist]){
						AddToSelect = Math.max(HobbyFloatPriceTogether[HobbyCode2Together[iii].codelist],AddToSelect);
					}
				}
			}
			if(AddToSelect>0){
				if((document.getElementById(ID + obj2[ii].value + "_Together" + prowid).innerHTML).indexOf("T"+jsMainHobbyType) >=0 ){
				obj2[ii].text = document.getElementById(ID + obj2[ii].value + "Value_Together" + prowid).innerHTML + "(+ "+getCurShow(jsCurName,jsSymbol,$.trim(String(AddToSelect)))+")";
				}
			}
		}
	}
	
}

function setLastProductPriceTogether(prowid,Discount){
	var strhobbycode = "";
	var isSelect = 0;
	var AddToSelect = 0;
	var strhobby = "";
	var isCustom = 0;
	var chgStock = true;
	if(prowid==1){
		HobbyCode2Together = HobbyCode2_Together1;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together1;
	}else if(prowid==2){
		HobbyCode2Together = HobbyCode2_Together2;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together2;
	}else if(prowid==3){
		HobbyCode2Together = HobbyCode2_Together3;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together3;
	}else if(prowid==4){
		HobbyCode2Together = HobbyCode2_Together4;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together4;
	}else if(prowid==5){
		HobbyCode2Together = HobbyCode2_Together5;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together5;
	}else if(prowid==6){
		HobbyCode2Together = HobbyCode2_Together6;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together6;
	}else if(prowid==7){
		HobbyCode2Together = HobbyCode2_Together7;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together7;
	}else if(prowid==8){
		HobbyCode2Together = HobbyCode2_Together8;
		HobbyFloatPriceTogether = HobbyFloatPrice_Together8;
	}
	for (i=1;i<=document.getElementById("HobbyCountTogether"+prowid).value;i++){
		ID = "HobbyNameTogether"+i+"_"+prowid;
		ID = String(document.getElementById(ID).value);
		if(String(document.getElementById("HobbyTogether"+i+"_"+prowid).value)!=0){
			ID = ID + String(document.getElementById("HobbyTogether"+i+"_"+prowid).value);
			ID = document.getElementById(ID+"_Together"+prowid).innerHTML;
			strhobbycode = ID;
			strhobby = strhobby + ID;
			if((strhobbycode).indexOf("T"+jsMainHobbyType) >=0 ){
				for(var i1=0;i1<HobbyCode2Together.length;i1++){
					if (strhobbycode == HobbyCode2Together[i1].code) {
						if(HobbyFloatPriceTogether[HobbyCode2Together[i1].codelist]){
						AddToSelect = Math.max(HobbyFloatPriceTogether[HobbyCode2Together[i1].codelist],AddToSelect);
						}
					}
				}
				newprice = (parseFloat(document.getElementById("producttogetherprice2_"+prowid).innerHTML) + parseFloat(AddToSelect) * Discount/100);
				if(parseFloat(AddToSelect)==0){
					oldprice = parseFloat(document.getElementById("producttogetheroldprice2_"+prowid).innerHTML);
				}else{
					oldprice = newprice*100/Discount;
				}
				isSelect = 1;
			}
		}else{
			chgStock = false;
			ID = ID + String(document.getElementById("HobbyTogether"+i+"_"+prowid).value);
			ID = document.getElementById(ID).innerHTML;
			strhobby = strhobby + ID;
		}
		if(document.getElementById("HobbyTogether"+i+"_"+prowid).disabled==true){
			isCustom = i;
		}
	}
	

	if(isSelect==0){
		newprice = parseFloat(document.getElementById("producttogetherprice2_"+prowid).innerHTML);
		oldprice = parseFloat(document.getElementById("producttogetheroldprice2_"+prowid).innerHTML);
	}
	
	if(jsCurName != "jpy" && jsCurName != 'idr' && jsCurName != 'rub')
	{
		newprice = newprice.toFixed(2);
		oldprice = oldprice.toFixed(2);
	}
	else
	{
		newprice = newprice.toFixed(0);
		oldprice = oldprice.toFixed(0);
	}
	if(isNaN(newprice)){}
	else{
		document.getElementById("producttogetherprice_"+prowid).innerHTML = getCurShow(jsCurName,jsCurName+jsSymbol,newprice,1);
		document.getElementById("producttogetheroldprice_"+prowid).innerHTML = getCurShow(jsCurName,jsCurName+jsSymbol,oldprice,1);
		/*
		if(document.getElementById("togethersaleprice"+prowid)){
			document.getElementById("togethersaleprice"+prowid).innerHTML = getCurShow(jsCurName,jsSymbol,oldprice-newprice,1);
		}
		*/
	}
	clkchkTogether();
}

function updatealltogetherprice(){
	toalloldprice = 0;
	toallnewprice = 0;
	toallsaveprice = 0;
	for (i=1;i<=document.getElementById("ProductCountTogether").value;i++){
		toalloldprice = parseFloat(toalloldprice) + parseFloat(document.getElementById("producttogetheroldprice_"+i).innerHTML);
		toallnewprice = parseFloat(toallnewprice) + parseFloat(document.getElementById("producttogetherprice_"+i).innerHTML);
	}
	if(jsCurName != "jpy" && jsCurName != 'idr' && jsCurName != 'rub')
	{
		toalloldprice = toalloldprice.toFixed(2);
		toallnewprice = toallnewprice.toFixed(2);
		toallsaveprice = (toalloldprice-toallnewprice).toFixed(2);
	}
	else
	{
		toalloldprice = toalloldprice.toFixed(0);
		toallnewprice = toallnewprice.toFixed(0);
		toallsaveprice = (toalloldprice-toallnewprice).toFixed(0);
	}
	document.getElementById("TogetherSaveSum").innerHTML = toallsaveprice;
	document.getElementById("TogetherPriceSum").innerHTML = toallnewprice;
}
function showIdinorProductAdd(isIdinorProduct){
	if(isIdinorProduct == 1 && ReadCookie("IDINORSTATS")==1){
		document.getElementById("addToCart_ip").style.display = "";
		document.getElementById("addToCart").style.display = "none";
		document.getElementById("addToCart_p").style.display = "none";
	}else if(isIdinorProduct == 1){
		document.getElementById("addToCart_ip").style.display = "none";
		document.getElementById("addToCart").style.display = "none";
		document.getElementById("addToCart_p").style.display = "";
	}else{
		document.getElementById("addToCart_ip").style.display = "none";
		document.getElementById("addToCart").style.display = "";
		document.getElementById("addToCart_p").style.display = "none";
	}
}



function dateonchange() {
	var yearObj = $('#selyear');
	var monthObj = $('#selmonth');
	var dayObj = $('#selday');
	var iyear = yearObj.val();
	var imonth = monthObj.val();
	
	var iMax = 28;
	if (imonth == 1 || imonth == 3 || imonth == 5 || imonth == 7 || imonth == 8 || imonth == 10 || imonth == 12) {
		iMax = 31;
	} else if (imonth == 4 || imonth == 6 || imonth == 9 || imonth == 11) {
		iMax = 30;
	} else if (iyear % 4 == 0 && imonth == 2) {
		iMax = 29;
	}
	var iCount = dayObj.children().length;
	if(iCount > iMax) {
		for(var i = 0; i < (iCount - iMax);i++) {
			dayObj.children(":last").remove();
		}
	} else if (iCount < iMax) {
		for(var i = iCount; i < iMax;i++) {
			dayObj.append('<option value="' + (i + 1) + '">' + (i + 1) + '</option>');
		}
	}
	
	dayonchange();
}

function dayonchange() {
	var yearObj = $('#selyear');
	var monthObj = $('#selmonth');
	var dayObj = $('#selday');
	var iyear = yearObj.val();
	var imonth = monthObj.val();
	var iday = dayObj.val();
	
	$('#WDate').val(formatwdate(iyear, imonth, iday)).focus();
}

function formatwdate(year, month, day) {
    month = String((month == "") ? 0 : month);
    day = String((day == "") ? 0 : day);
    year = String((year == "") ? 0 : year);
    month = "00".substr(0, 2 - month.length) + month;
    day = "00".substr(0, 2 - day.length) + day;
    year = "0000".substr(0, 4 - year.length) + year;

    return (month + "/" + day + "/" + year).replace(/0000$/, '').replace(/00\/$/, '');
}
function changeAddCartBtn(productID,countryInfo){
	$.ajax({
			  type:'get',
			  url:jsMainSiteUrl+'GetProductSaleOfStateByCountyAjax.cfm',
			  data:"productID="+productID+"&countryInfo="+countryInfo,
			  success:function(result){
				  	  // 如果该国家直接则把add to cart 按钮变灰
					  if(trim(result)==0){
						  $("#AddToCartBn").hide();
						  $("#AddToCartBn_Gray").show();
						  $("#AddToCartBn_Info").show();
					  }else{// 不处理
						  $("#AddToCartBn").show();
						  $("#AddToCartBn_Gray").hide();
						  $("#AddToCartBn_Info").hide();
					  }
				  }
			});		
}

function changeColor(tv){
	if(document.getElementById("colero")){
		if(tv=='3183989' || tv=='3160382'){
			document.getElementById("colero").style.display='';
		}else{
			document.getElementById("colero").style.display='none';
		}
	}
}

function showHotProduct(obj){
	if(obj=='C'){
		document.getElementById('C_Menu_1').className = 'det_tab_t';	
		document.getElementById('C_Menu_2').className = 'det_tab_t1';
		document.getElementById('C_Menu_3').className = 'det_tab_t2 tit14b red';
		document.getElementById('C_Menu_4').className = 'det_tab_t3';
		document.getElementById('H_Menu_1').className = 'det_tab_d';
		document.getElementById('H_Menu_2').className = 'det_tab_d1';
		document.getElementById('H_Menu_3').className = 'det_tab_d2 tit14';
		document.getElementById('H_Menu_4').className = 'det_tab_d3';
		document.getElementById('Mightlike').style.display = '';
		document.getElementById('HotProduct').style.display = 'none';
	}else{
		document.getElementById('C_Menu_1').className = 'det_tab_d';	
		document.getElementById('C_Menu_2').className = 'det_tab_d1';
		document.getElementById('C_Menu_3').className = 'det_tab_d2 tit14';
		document.getElementById('C_Menu_4').className = 'det_tab_d3';
		document.getElementById('H_Menu_1').className = 'det_tab_t';
		document.getElementById('H_Menu_2').className = 'det_tab_t1';
		document.getElementById('H_Menu_3').className = 'det_tab_t2 tit14b red';
		document.getElementById('H_Menu_4').className = 'det_tab_t3';
		document.getElementById('Mightlike').style.display = 'none';
		document.getElementById('HotProduct').style.display = '';
	}
}
