﻿
function OpenCatalogueRequest(I_chaCatalogueID)
{
	window.location.href='construction_msg.asp';	
	// OpenWindow("catalogue_request.asp?CatalogueID=" + I_chaCatalogueID, 1000, 500, "<font class=bt_txt_6>&#35746;&#38405;&#30005;子型&#24405;</font>");
}

function OpenCatalogueToFriend(I_chaCatalogueID)
{
	OpenWindow("catalogue_tofriend.asp?CatalogueID=" + I_chaCatalogueID, 550, 650, "<font class=bt_txt_6>&#36716;寄&#32473;好友</font>");
}

function OpenCategoryToFriend(I_chaCategoryIDL4, I_chaProductID)
{
	OpenWindow("category_tofriend.asp?CategoryID_L4=" + I_chaCategoryIDL4 + "&ProductID=" + I_chaProductID, 550, 650, "<font class=bt_txt_6>&#36716;寄&#32473;好友</font>");
}


function OpenStoreDetail(I_chaAreaID, I_chaStoreID)
{
	OpenWindow("store_detail.asp?AreaID=" + I_chaAreaID + "&StoreID=" + I_chaStoreID, 530, 400, "<font class=bt_txt_6>分店&#36164;&#35759;</font>");
}

function OpenProductPic(I_chaProductID)
{
	OpenWindow("product_pic.asp?ProductID=" + I_chaProductID, 530, 540, "<font class=bt_txt_6>商品&#36164;&#35759;</font>");
}

function OpenProductSalePic(I_chaProductID)
{
	OpenWindow("product_sale_pic.asp?ProductID=" + I_chaProductID, 530, 540, "<font class=bt_txt_6>商品&#36164;&#35759;</font>");
}

function OpenSignIn()
{
	OpenWindow("sign_in.asp", 730, 400, "<font class=bt_txt_6>&#20250;&#21592;登入</font>");
}

function OpenForgotPassword()
{
	OpenWindow("forgot_password.asp", 730, 400, "<font class=bt_txt_6>忘&#35760;密&#30721;</font>");
}


function OpenAddToFavorite(I_boolSignIn, I_chaProductID)
{
	window.location.href='construction_msg.asp';
	/*
	if (I_boolSignIn == 'T') {	
		OpenWindow("favorites_add.asp?ProductID=" + I_chaProductID, 650, 550, "<font class=bt_txt_6>加入我的最&#29233;</font>");	
	} else {
		OpenWindow("sign_in.asp", 730, 400, "<font class=bt_txt_6>&#20250;&#21592;登入</font>");
	}	
	*/
}

function OpenAddToCart(I_boolSignIn, I_chaProductID)
{
	window.location.href='construction_msg.asp';
	// OpenWindow("cart_add.asp?ProductID=" + I_chaProductID + "&Qty=1", 650, 550, "<font class=bt_txt_6>加入&#36141;物&#36710;</font>");	
}

function OpenAddToCart(I_boolSignIn, I_chaProductID, I_intQty)
{
	window.location.href='construction_msg.asp';
	// OpenWindow("cart_add.asp?ProductID=" + I_chaProductID + "&Qty=" + I_intQty, 650, 550, "<font class=bt_txt_6>加入&#36141;物&#36710;</font>");	
}

function OpenAccount(I_boolSignIn)
{
	if (I_boolSignIn == 'T') {
		window.location.href='account.asp';
	} else {
		OpenWindow("sign_in.asp", 730, 400, "<font class=bt_txt_6>&#20250;&#21592;登入</font>");
	}
}

function OpenChangePassword(I_boolSignIn)
{
	if (I_boolSignIn == 'T') {
		window.location.href='change_password.asp';
	} else {
		OpenWindow("sign_in.asp", 730, 400, "<font class=bt_txt_6>&#20250;&#21592;登入</font>");
	}
}

function OpenForgotPassword()
{
	OpenWindow("forgot_password.asp", 730, 400, "<font class=bt_txt_6>忘&#35760;密&#30721;</font>");
}

function OpenAccountUpdate(I_boolSignIn)
{
	if (I_boolSignIn == 'T') {
		window.location.href='account_update.asp';
	} else {
		OpenWindow("sign_in.asp", 730, 400, "<font class=bt_txt_6>&#20250;&#21592;登入</font>");
	}
}

function OpenOrderTracking(I_boolSignIn)
{
	window.location.href='construction_msg.asp';
	/*
	if (I_boolSignIn == 'T') {
		window.location.href='order_tracking.asp';
	} else {
		OpenWindow("sign_in.asp", 730, 400, "<font class=bt_txt_6>&#20250;&#21592;登入</font>");
	}
	*/
}

function OpenFavoritesList(I_boolSignIn)
{
	window.location.href='construction_msg.asp';
	/*
	if (I_boolSignIn == 'T') {
		window.location.href='favorites_list.asp';
	} else {
		OpenWindow("sign_in.asp?RedirectURL=favorites_list.asp", 730, 400, "<font class=bt_txt_6>&#20250;&#21592;登入</font>");
	}
	*/
}

function OpenCheckOut(I_boolSignIn)
{
	window.location.href='construction_msg.asp';
	/*
	if (I_boolSignIn == 'T') {
		window.location.href='checkout.asp';
	} else {
		OpenWindow("sign_in.asp?RedirectURL=checkout.asp", 730, 400, "<font class=bt_txt_6>&#20250;&#21592;登入</font>");
	}
	*/
}

function OpenCartList(I_boolSignIn)
{
	window.location.href='construction_msg.asp';
	// window.location.href='cart_list.asp';
}

function OpenPrivacyPolicy()
{
	window.location.href='construction_msg.asp';
	// OpenWindow("privacy_policy.asp", 600, 550, "<font class=bt_txt_6>&#38544;私&#26435;政策</font>");
}

function OpenTermsOfUse()
{
	window.location.href='construction_msg.asp';	
	// OpenWindow("terms_of_use.asp", 600, 550, "<font class=bt_txt_6>服&#21153;&#26465;款</font>");
}

function OpenCustomerFeedback()
{
	OpenWindow("customer_feedback.asp", 600, 550, "<font class=bt_txt_6>客&#25143;反&#39304;</font>");
}

function OpenCareerFrom(I_intTKey)
{
	OpenWindow("career_from.asp?funs=n&FrmTKey=" + I_intTKey, 460, 550, "<font class=bt_txt_6>人才招募</font>");
}

function OpenConvey()
{
	OpenWindow("convey.asp", 800, 550, "<font class=bt_txt_6>&#36816;送方式</font>");
}

function openExternalLink(url){
    window.open("http://" + url, 'link');
}

//**************************************************************************
 
function OpenWindow(url, width, height, title, onCloseClick,windowType) {

    if(typeof(title) == 'undefined' || title == false || title == null)
        {title = '';}
        
    if(!myLightWindow)
    {
		try
		{
			trace("My Light window initializing...");
			lightwindowInit();
		}
		catch(e)
		{
			alert("Lightwindow did not initialize");
		}
    }
    

	myLightWindow.activateWindow({
		href: url, 
		title: title, 
		height: height, // We need a variable height
		width: width, // And a variable width
		resizeSpeed : 8,
		type: windowType || 'external',
		loadingAnimation : true,
		// What form method should be used
		formMethod : 'get',
		// Should flash objects be hidden on the page when the window opens
		hideFlash : true,
		// Hide the gallery tab
		hideGalleryTab : true,
		// Show the gallery count when viewing a gallery
		showGalleryCount : false,
		// Define your own handlers here, see the 'How to Theme Section'
		animationHandler : false,
		navigationHandler : false,
		transitionHandler : false,
		finalAnimationHandler : false,
		formHandler : false,
		galleryAnimationHandler : false,
		lightwindow_loading_animation: false    
	});

  	
}

function CloseAllWindows(Delegate_OnCloseComplete)
{
	//UI.defaultWM.windows().each(function(win){win.hide();win.fire("destroyed");});
	myLightWindow.deactivate();
		
	if(Delegate_OnCloseComplete)
		Delegate_OnCloseComplete();
}
