var gPage;
window.onload=function(){
gPage.init();
};
function Page(){
this.iMenu=null;
this.iLoginTask=null;
this.iPageTipsTask=null;
this.iDialog=null;
var _1;
var _2;
this.clearOrder=function(){
var _3="do you want to delete all the images from the current order?";
this.iDialog=new Dialog("confirm clear order",_3,null,this,this.confirmClearCallback);
this.iDialog.display();
};
this.confirmClearCallback=function(_4){
if(_4){
_1=HTTP.newRequest();
_1.open("GET","data/clearOrder.php",true);
_1.onreadystatechange=function(){
gPage.handleClearOrderResponse();
};
_1.send(null);
_2=window.setTimeout("gPage.clearOrderTimedOut();",10000);
if(window.location.pathname.match(/order\.php/)){
gUtils.gotoLocalPage("order.php?page=0");
}
}
};
this.handleClearOrderResponse=function(){
if(_1.readyState==4){
window.clearTimeout(_2);
if(_1.status==200&&_1.responseText=="ok"){
$("checkout_link").style.display="none";
$("supernav_divider_0").style.display="none";
$("clear_order_link").style.display="none";
$("supernav_divider").style.display="none";
this.iDialog=new Alert("order cleared","your order has been cleared");
this.iDialog.display();
}
_1=null;
_2=null;
}
};
this.clearOrderTimedOut=function(){
_1=null;
_2=null;
this.iDialog=new Alert("request timed out","server error: clear order request timed out");
this.iDialog.display();
};
this.equaliseColumns=function(){
$("taskbar_stretch").style.height="0px";
$("leftcol_stretch").style.height="0px";
var _5=gUtils.getElementBrPos($("leftcol_content"),true).y;
var _6=gUtils.getElementBrPos($("taskbar_content"),true).y+$("taskbar_footer").offsetHeight+15;
if(_6>_5){
$("taskbar_stretch").style.height="0px";
$("leftcol_stretch").style.height=(_6-_5)+"px";
}else{
$("leftcol_stretch").style.height="0px";
$("taskbar_stretch").style.height=(_5-_6)+"px";
}
};
}
Page.prototype.init=function(){
window.setTimeout(this.equaliseColumns,100);
gConst.getEmbeddedConstants();
this.iMenu=new Menu();
this.iMenu.init();
if($("pageMessage")&&$("pageMessage").innerHTML.length>0){
this.iDialog=new TimedAlert("message",$("pageMessage").innerHTML);
this.iDialog.display();
}
this.iPageTipsTask=new PageTipsTask();
this.iPageTipsTask.init();
if($("user_email_login")){
this.iLoginTask=new LoginTask();
this.iLoginTask.init();
}
var _7=$("clear_order_link");
if(_7){
_7.href="javascript: gPage.clearOrder();";
}
document.getElementsByTagName("body")[0].style.backgroundColor="#e6e6e6";
document.documentElement.style.backgroundColor="#e6e6e6";
};

