var env = "prod"; // dev = developement, stag = staging, prod = production

var wwwroot = "http://hk.asia.acuvue.com/av/";
var ssl_wwwroot = "https://hk.asia.acuvue.com/av/";
var us_wwwroot = "http://www.acuvue.com.hk/";
if (env == "dev")
{
   wwwroot = "http://hk.asia.av.dev.hk.agenda-asia.com/av/";
   ssl_wwwroot = "http://hk.asia.av.dev.hk.agenda-asia.com/av/";
   us_wwwroot = "http://www.av.dev.hk.agenda-asia.com/";
} 
else if (env == "stag")
{
	wwwroot = "http://hk-staging.asia.acuvue.com/av/";
	ssl_wwwroot = "https://hk-staging.asia.acuvue.com/av/";
	us_wwwroot = "http://stage.acuvue.com.hk/";

}

// Global Variable Declarations
ns4 = (document.layers)? true:false; // netscape 4?
ie4 = (document.all)? true:false; // internet explorer 4/5?
ns6 = (ns4|ie4)? false:true; // (Netscape 6)

var isLoaded=false;

var screen_top=(screen.height/2)-(500/2);
var screen_left=(screen.width/2)-(300/2);

// Image Functions

/*var DomainName = 'hk.asia.av.dev.hk.agenda-asia.com'; 
var FormApplicationPath = 'av/forms/'; 
var ApplicationPath = 'oasys/'; 
var us_wwwroot = "http://www.acuvue.com.hk";*/
var DomainName = wwwroot
var FormApplicationPath = 'forms/'; 
var ApplicationPath = 'oasys/'; 



openWin = function (url, name, width, height, xpos, ypos, chrome, scroll, resizable){
  var x, y, w, h, moveX=0, moveY=0, features="";
  chrome = chrome ? "yes" : "no";
  scroll = scroll ? "yes" : "no";
  resizable = resizable ? "yes" : "no";
  features += "toolbar="+chrome+",location="+chrome+",status="+chrome+",menubar="+chrome;
  features += ",scrollbars="+scroll+",resizable="+resizable;
  if(width) features += ",width="+width;
  if(height) features += ",height="+height;
  if(xpos && window.screen){
    w = window.screen.availWidth;
    width = parseInt(width);
    switch(xpos){
      case "left": x = 0; break;
      case "center": x = (w-width)/2; break;
      case "right": x = w-width; break;
      default: x = xpos;
    }
    features += ",screenX="+x+",left="+x;
    var moveX = x;
  }
  if(ypos && window.screen){
    h = window.screen.availHeight;
    height = parseInt(height);
    switch(ypos){
      case "top": y = 0; break;
      case "middle": y = (h-height)/2; break;
      case "bottom": y = h-height; break;
      default: y = ypos;
    }
    features += ",screenY="+y+",top="+y;
    var moveY = y;
  }
  features +=",left="+moveX+",top="+moveY;
	eval("openWinReference = window.open(url, name, features);");  
	openWinReference.focus();
}

function openeFPP(){
	//window.open("http://" + DomainName + "/" + FormApplicationPath + "promotions/eCampaign.aspx?campaignid=12","newWin","");
	window.open(DomainName + "/" + FormApplicationPath + "promotions/eCampaign.aspx?campaignid=12","newWin","");
}

function openForwardToFriend(page){
	var path = "/";
	if (page!=undefined){
		switch (page.toLowerCase()){
			case "demo":
				path="/%23navigationPath%3DDemo";
				break;
			default:
				break;
		}
	}
	var title = "ACUVUE%AE%20OASYS%u2122%20with%20HYDRACLEAR%u2122%20Plus";
	//openWin("http://" + DomainName + "/" + FormApplicationPath +"products/forwardFriends.aspx?ub=6&url="+path+"&title="+title,"ForwardFriends",613,650,"center","middle",false,"scroll");
	openWin(DomainName + "/" + FormApplicationPath +"products/forwardFriends.aspx?ub=6&url="+path+"&title="+title,"ForwardFriends",613,650,"center","middle",false,"scroll");
}

function openWhereToBuy(){
	//var _wheretobuy = window.open("http://" + DomainName + "/av/products/wheretofind.aspx?productid=15","new","");
	var _wheretobuy = window.open(DomainName + "/av/products/wheretofind.aspx?productid=15","new","");
}

function openTrialForm(){
	//window.open("http://" + DomainName + "/" + FormApplicationPath + "promotions/oasys_etrial.aspx","newWin","");
	window.open(DomainName + "/" + FormApplicationPath + "promotions/oasys_etrial.aspx","newWin","");
}



function doTracking(pagename){	
	
}

function openTrialTnC(){
	//alert("openTrialTnC");
	openWin("trial_tnc.html","registration_tc",613,640,"center","middle",false,"scroll");
}

function openSurvey(){
	//alert("openSurvey");
	//window.open("https://hk.asia.acuvue.com/av/forms/promotions/oasyscampaign/survey/index.aspx");
	window.open(wwwroot+"forms/promotions/oasyscampaign/survey/index.aspx");
}
function openRegForm(){
	//alert("openRegForm");
	//window.open("https://hk.asia.acuvue.com/av/forms/promotions/oasyscampaign/index.aspx");
	openWin(wwwroot+"forms/promotions/oasyscampaign/index.aspx","registration",613,640,"center","middle",false,"scroll");
}
function openRegEFPP(){
	//alert("openRegEFPP");
	//window.open("https://hk.asia.acuvue.com/av/forms/promotions/ecampaign.aspx?campaignid=12");
	openWin(wwwroot+"forms/promotions/ecampaign.aspx?campaignid=12","efpp",613,640,"center","middle",false,"scroll");
}
function openECPList(){
	//alert("openECPList");
	//window.open("http://hk.asia.acuvue.com/av/forms/promotions/ecampaignecplist.aspx?campaignid=30&readonly=1");
	openWin(wwwroot+"forms/promotions/ecampaignecplist.aspx?campaignid=30&readonly=1","ecp",613,640,"center","middle",false,"scroll");
}

function contactus(){
	window.open(wwwroot+"forms/contactUs.aspx","new","");
	
}
function legal_notice(){
	window.open(us_wwwroot+"common/legal-notice.html","new","");
	
}
function our_credo(){
	window.open(us_wwwroot+"about-acuvue/our-credo.html","new","");
	
}
function privacy(){
	window.open(us_wwwroot+"common/privacy-policy.html","new","");
	
}