﻿// JScript 文件
var pathMend = "";
if( window.location.href.indexOf("localhost") > -1)   //为测试做的补丁
    pathMend = "/Shop" ;
var L_pop = null;
function ShowLargess(id)
{
//	L_pop=new Popup({ contentType:1, isReloadOnClose:false, width:400, height:300 });
//	L_pop.setContent("title","赠送物品");
//	L_pop.setContent("contentUrl",pathMend + '/Send.aspx?id='+id);
//	L_pop.build();
//	L_pop.show();
	//return false;
	//showPopWin(pathMend+'/index.aspx',500,400,null)
	showPopWin(pathMend + '/Send.aspx?id='+id, 430, 300, "1")
}
function L_close_pop(NotShowCart)
{
	
	if(NotShowCart == null)
	{

	showPopWin(pathMend + '/Cart.aspx', 880, 520, "1")

	}
	
}


var M_pop = null;
function ShowMSend(id,vgid,count)
{

	showPopWin(pathMend + '/member/MSend.aspx?id='+id+'&&vgid='+vgid+'&&count='+count, 450, 320, "1")
	
	
}
function ShowMUse(id,vgid,count)
{

	showPopWin(pathMend + '/member/MUse.aspx?id='+id+'&&vgid='+vgid+'&&count='+count, 450, 320, "1")
	
	
}
function M_close_pop()
{
	M_pop.close();	
}



var G_pop = null;
function ShowCart(qs)
{
//	G_pop=new Popup({ contentType:1, isReloadOnClose:false, width:860, height:600 });
//	G_pop.setContent("title","我的购物车");
//	G_pop.setContent("contentUrl",pathMend + '/Cart.aspx' + (qs==null?"":"?"+qs));
//	G_pop.build();
//	G_pop.show();
//	//return false;
	
	showPopWin(pathMend + '/Cart.aspx' + (qs==null?"":"?"+qs), 880, 520,"1")
}
function G_close_pop()
{
	window.top.hidePopWin();
}


var B_pop = null;
function ShowList(id)
{
//	B_pop=new Popup({ contentType:1, isReloadOnClose:false, width:860, height:600 });
//	B_pop.setContent("title","请选择您要购买的礼品");
//	B_pop.setContent("contentUrl",pathMend + '/BuyActual.aspx?id='+id);
//	B_pop.build();
//	B_pop.show();
	//return false;
	showPopWin(pathMend + '/BuyActual.aspx?id='+id, 860, 500, null)
}
function B_close_pop(NotShowCart)
{
    window.top.hidePopWin();
	ShowCart();
}



var Login_pop = null;
var isOpening = false;
function ShowLogin(callback,direct)
{

//	if(!isOpening)
//	{
//	    Login_pop=new Popup({ contentType:1, isReloadOnClose:false, width:390, height:220 });
//	    Login_pop.setContent("title","用户登录");
//	    Login_pop.setContent("contentUrl",pathMend + '/Frame/Login.aspx' + (direct==null?"":"?ReturnUrl=" +direct));
//		Login_pop.setContent("callBack",callback == callback);
////		Login_pop.setContent("parameter",{paras:para});
//		Login_pop.build();
//		Login_pop.show();
////showPopWin(pathMend + '/Frame/Login.aspx' + (direct==null?"":"?ReturnUrl=" +direct, 430, 300,null)
//	}
//	else
//		alert("正在处理，请稍后……");
	//return false;
	//alert(pathMend + '/Frame/Login.aspx' +( direct==null?"":"?ReturnUrl=" +direct))

	showPopWin(pathMend + '/Frame/Login.aspx' +( direct==null?"":"?ReturnUrl=" +direct), 390, 220,"1")

}
function CloseLogin()
{
    window.location = window.location;
    return;
//	Login_pop.close();
//    if(Login_pop.info.callBack != null)
//    {
//        eval(Login_pop.info.callBack);
//    }
}

function alertPop(tit,con)
{
//	var pop=new Popup({ contentType:4,isReloadOnClose:false,width:340,height:80});
//	pop.setContent("title",tit);
//	pop.setContent("alertCon",con);
//	pop.build();
//	pop.show();
	showPopWin(pathMend + '/Message.aspx?title='+tit+'&content='+con, 390, 220,null)
}


var Receive_pop = null;
function ShowReceive(id)
{
	Receive_pop=new Popup({ contentType:1, isReloadOnClose:false, width:400, height:360 });
	Receive_pop.setContent("title","获赠礼品查看");
	Receive_pop.setContent("contentUrl",pathMend + '/Member/receive.aspx?id=' + id);
	Receive_pop.build();
	Receive_pop.show();
	//return false;
}
function Receive_close_pop()
{
	Receive_pop.close();
}



function Nav_GoMember()
{
    top.location.href = pathMend + '/Member/';
}
function Nav_GoCart()
{
    ShowCart();
}
function Nav_GoVShop()
{
    top.location.href = pathMend + '/';
}
function Nav_GoAShop()
{
    top.location.href = pathMend + '/AIndex.aspx';
}
function Nav_GoBursary()
{
    top.location.href = 'http://www.lookingon.com/Bursary/';
}
function Nav_GoGuide()
{
    top.location.href = pathMend + '/Guide/';
}
function Nav_GoMate()
{
    top.location.href = pathMend + '/GoMate.aspx';
}
function showTime()
{
  var week,day,month,year
  function initArray(){
  this.length = initArray.arguments.length
  for (var i = 0; i < this.length; i++)
  this[i+1] = initArray.arguments[i]
  }
  var LastModDate = new Date(document.lastModified);
  var WeekArray = new initArray("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
  var MonthArray = new initArray("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
  day = LastModDate.getDate() +"日";
  year = LastModDate.getFullYear() +"年";
  week = WeekArray[(LastModDate.getDay()+1)];
  month = MonthArray[(LastModDate.getMonth()+1)];
  if(document.getElementById("SCurrentDate")!=null)
  {
    SCurrentDate.innerHTML = year+month+day;
  var vHour = LastModDate.getHours()
var vMin = LastModDate.getMinutes()
var vSec = LastModDate.getSeconds()
var hh = vHour<10 ? "0" + vHour : vHour;
var mm = vMin<10 ? "0" + vMin : vMin;
var ss = vSec<10 ?  "0"+ vSec : vSec;
  SCurrentTime.innerHTML = hh + ":" + mm + ":" + ss ;
 // SCurrentWeek.innerHTML = week;
  }
}
window.setInterval("showTime()",1000);


