var POPUP_MESSAGE = "Please disable your popup blockers for this site";

function GetMyObjectByID(itemID)
{
// In the future will need to build in the ability to handle v4 netscape browsers.
	if (document.getElementById) // Good browsers
		return document.getElementById(itemID)
	else if (document.all) // medium browsers
		return document.all[itemID];
		
	// Need to handle v4 browsers in the future.
}
function MakeMiddle()
{
	var height = getHeight();
	if((height - 575) >0)
	{

		var diff = (((height - 575)/2) - 60);

		var o = GetMyObjectByID("flashcontent")
		o.style.paddingTop = diff +"px";
		o.style.display = "block";
		
	}
	
}
function getHeight() {
      return (
         self.innerHeight
         || document.documentElement.clientHeight
         || document.body.clientHeight
      );
   };
   
   
function ApplyForJob(job_id)
{
	var url = "http://www.sunglasshut.com.au/job-application.html?"+ GetSiteParm();
	
	if(job_id!=0)
		url = "http://www.sunglasshut.com.au/job-application.html?"+ GetSiteParm() +"&job_id="+ job_id;
	
	var win = window.open(url,"jobapp","width=690, height=750, toolbars=no, scrollbars=yes");
	if(win == null || win == undefined)
	{
		// Blocked
		alert("POPUP_MESSAGE")
	}
}

function GiftVoucher()
{
	var url = "https://online.sunglasshut.com.au/gift-vouchers.html?"+ GetSiteParm();
	var win = window.open(url,"gift","width=690, height=750, toolbars=no, scrollbars=yes");
	if(win == null || win == undefined)
	{
		// Blocked
		alert("POPUP_MESSAGE")
	}
}

function StoreLocator()
{
	var url = "http://www.sunglasshut.com.au/store-locator.html?"+ GetSiteParm();
	var win = window.open(url,"locator","width=690, height=750, toolbars=no, scrollbars=yes");
	if(win == null || win == undefined)
	{
		// Blocked
		alert("POPUP_MESSAGE")
	}
}
   
function GetSiteParm()
{
	if(document.location.href.indexOf(".com.au") > 0)
		return "site=sunglasshut.com.au";
	else
		return "site=sunglasshut.co.nz";
}
   
   
 