function justTest(word) {
 alert(word);
}

function strRootPath(){
	var strCfgRoot = "";
	var strCfgMainUrl = "";
	if("localhost"==document.domain){ // webserver
		strCfgRoot = "/mart";
		strCfgMainUrl = "http://" + document.domain + strCfgRoot;
	}else{ // Server
		strCfgMainUrl = "http://" + document.domain + strCfgRoot;
	}
	return strCfgMainUrl;
}

function fnShoppingList(){
	var lroot=strRootPath();
	var show=document.getElementById('ShoppingList-Detail').style.display;
	if(show=='' || show=='block'){
		document.getElementById('ShoppingList').style.background='url('+lroot+'/engine/BG-ShoppingList.jpg) no-repeat top';
		$('#ShoppingList-Detail').slideToggle(500);
	}else{
		document.getElementById('ShoppingList').style.background='url('+lroot+'/engine/BG-ShoppingList-Up.jpg) no-repeat top';
		$('#ShoppingList-Detail').slideToggle(500);
	}
}

function fnBranch(zone,goodsId){
	//categoryName = escape(categoryName);
	//lroot=strRootPath();
	//document.getElementById('TopMain').focus();
	//tb_show('', '/misc/check_branch.php?height=300&width=500', '');
	tb_show('', '/misc/check_branch.php?zone='+zone+'&goodsId='+goodsId+'&height=450&width=500', ''); 
}

function fnBranch2(zone,goodsId){
	tb_show('', '/misc/check_branch2.php?zone='+zone+'&goodsId='+goodsId+'&height=450&width=500', ''); 
}

function fnCheckBranch(){
	lroot=strRootPath();
	//document.getElementById('TopMain').focus();
	tb_show('', lroot+'/lib/popup_checkBranch.php?height=300&width=500', '');
}

function fnConvertBranch(p){
	tb_show('', '/misc/convert_branch.php?p='+p+'&height=450&width=500', ''); 
}

function fnReorder(p){
	tb_show('', '/misc/re_order.php?branchId='+p+'&height=350&width=500', ''); 
}

function fnConFirmTime(){
	tb_show('', '/misc/conFirmTime.php?height=350&width=500', ''); 
}

function fnSendToFriend(zone,goodsId,branchId){
	tb_show('', '/misc/sendToFriend.php?zone='+zone+'&goodsId='+goodsId+'&branchId='+branchId+'&height=350&width=500', ''); 
}

function fnSendToFriendIntroduce(zone,goodsId,branchId){
	tb_show('', '/misc/sendToFriend_introduce.php?zone='+zone+'&goodsId='+goodsId+'&branchId='+branchId+'&height=350&width=500', ''); 
}

function fnThankCustomer(orderNumber,email){
	tb_show('', '/misc/thank.php?orderNumber='+orderNumber+'&email='+email+'&height=400&width=500', ''); 
}

function fnOldCustomer(p){
	tb_show('', '/misc/old_customer.php?p='+p+'&height=350&width=500', ''); 
}

function fnCheckout(){
	tb_show('', '/misc/checkout.php?height=350&width=500', ''); 
}

function fnConfirm(sum){
	tb_show('', '/misc/confirm.php?sum='+sum+'&height=350&width=500', ''); 
}

function fnHowtoShop(){
	tb_show('', '/misc/howtoShop.php?height=475&width=500', ''); 
}

function fnImageBig(goodsId){
	tb_show('', '/misc/viewImageBig.php?goodsId='+goodsId+'&height=570&width=570', ''); 
}

function fnRegister(){
	lroot=strRootPath();
	tb_show('', lroot+'/lib/popup-register.html?height=600&width=600', '');
}
function fnSummary(){
	lroot=strRootPath();
	tb_show('', lroot+'/lib/popup-summary.html?height=510&width=680', '');
}

function fnEbrochureAddCart(productId){
	tb_show('', '/misc/lightbox_addCart.php?productId='+productId+'&height=450&width=500', ''); 
}

function fnAddCart_product(goodsId){
	tb_show('', '/misc/lightbox_product_addCart.php?goodsId='+goodsId+'&height=450&width=500', ''); 		
}

function fnAddCart_promotion(goodsId){
	tb_show('', '/misc/lightbox_promotion_addCart.php?goodsId='+goodsId+'&height=450&width=500', ''); 
}

function fnAddCart_bigcBrand(goodsId){
	tb_show('', '/misc/lightbox_bigcBrand_addCart.php?goodsId='+goodsId+'&height=450&width=500', ''); 
}

function fnAddCart_productDetail(goodsId,zone){
	tb_show('', '/misc/lightbox_productDetail_addCart.php?goodsId='+goodsId+'&zone='+zone+'&height=450&width=500', ''); 
}

function fnAddCart_voucher(goodsId){
	tb_show('', '/misc/lightbox_voucher_addCart.php?goodsId='+goodsId+'&height=450&width=500', ''); 
}

function fnAddCart_index(goodsId){
	tb_show('', '/misc/lightbox_index_addCart.php?goodsId='+goodsId+'&height=450&width=500', ''); 
}

function fnAddCart_home(goodsId){
	tb_show('', '/misc/lightbox_home_addCart.php?goodsId='+goodsId+'&height=450&width=500', ''); 
}

function fnAddCart_search(goodsId){
	tb_show('', '/misc/lightbox_search_addCart.php?goodsId='+goodsId+'&height=450&width=500', ''); 
}

function fnAddCart_bannerPromotion(goodsId){
	tb_show('', '/misc/lightbox_home_addCart.php?goodsId='+goodsId+'&height=450&width=500', '');  
}

function fnAddCart_setSingles(){
	tb_show('', '/misc/lightbox_singles_addCart.php?height=450&width=500', '');  
}

function fnAddCart_setSmallFamily(){
	tb_show('', '/misc/lightbox_smallFamily_addCart.php?height=450&width=500', '');  
}

function fnAddCart_setBigFamily(){
	tb_show('', '/misc/lightbox_bigFamily_addCart.php?height=450&width=500', '');  
}

function fnAddCart(){
	var num=$('#numProduct').val();
	queryStr="num="+num
	$.ajax({
					   type: "POST",
					   url: "addcart.php",
					   cache: false,
					   data: queryStr,
					   success: function(response){
						 setTimeout("finishAddCart('boxCheckout','"+num+"', '"+escape(response)+"')", 0);
					   }
	});
}

function finishAddCart(id,num,response){
	$('#'+id).html(unescape(response));
	//$('#'+id).html('<img src="engine/SProduct-01.gif" /><br><span class="DetailLProduct">HP Pavilion p6100z series</span>');
	$('#numP').html(num);
	$('#ShoppingList-Detail').slideDown(500);
}

function boxslidepic(i,numPic,newload){
	//alert(i)
	if(!newload || newload==''){
		if(i>numPic) i=1;
		
		if(i==1){ 
			$('#slide'+numPic).hide();
		}
		else{
			$('#slide'+(i*1-1)).hide();
		}
		
		$('#slide'+i).show();
	}else{
		$('#slide1').show();
	}
	setTimeout("boxslidepic('"+(i*1+1)+"', '"+numPic+"')", 5000);
}

