// JavaScript Document
//łśćłżź

var DebugMode=false; //Show Alerts

var GlobalSecureURL='https://myhealthangel01.worldsecuresystems.com'; //without slash at end !!!
var GlobalDomains = new Array();

/* =============================== DomainsRedirect [START] ========================== */
GlobalDomains[0] = {};
GlobalDomains[0].name='http://www.buyisowhey.com.au'; //without slash at end !!!
GlobalDomains[0].startpage='_catalog_49842/IsoWhey'; //without slash at the begining and at end !!!

GlobalDomains[1] = {};
GlobalDomains[1].name='http://buyisowhey.com.au'; //without slash at end !!!
GlobalDomains[1].startpage='_catalog_49842/IsoWhey'; //without slash at the begining and at end !!!

GlobalDomains[2] = {};
GlobalDomains[2].name='http://www.buyisowheycomplete.com.au'; //without slash at end !!!
GlobalDomains[2].startpage='_catalog_49842/IsoWhey'; //without slash at the begining and at end !!!

GlobalDomains[3] = {};
GlobalDomains[3].name='http://buyisowheycomplete.com.au'; //without slash at end !!!
GlobalDomains[3].startpage='_catalog_49842/IsoWhey'; //without slash at the begining and at end !!!

GlobalDomains[4] = {};
GlobalDomains[4].name='http://www.isowheydiet.com.au'; //without slash at end !!!
GlobalDomains[4].startpage='_catalog_49842/IsoWhey'; //without slash at the begining and at end !!!

GlobalDomains[5] = {};
GlobalDomains[5].name='http://isowheydiet.com.au'; //without slash at end !!!
GlobalDomains[5].startpage='_catalog_49842/IsoWhey'; //without slash at the begining and at end !!!


GlobalDomains[6] = {};
GlobalDomains[6].name='http://www.isowheyweightloss.com.au'; //without slash at end !!!
GlobalDomains[6].startpage='_catalog_49842/IsoWhey'; //without slash at the begining and at end !!!

GlobalDomains[7] = {};
GlobalDomains[7].name='http://isowheyweightloss.com.au'; //without slash at end !!!
GlobalDomains[7].startpage='_catalog_49842/IsoWhey'; //without slash at the begining and at end !!!
/* =============================== DomainsRedirect [END] ============================ */
/* =============================== redirectSecure [START] =========================== */
var DebugMode=true;
function redirectSecure(){ 
	/*redirectSecure v1.1 (GlobalDomains Required !!!*/
	/*Original redirectSecure located in functions.js*/
	try{
		var SiteUrl=document.location
		var SiteUrlString=String(SiteUrl);
		var VarsExists=String(SiteUrl).indexOf("/");
		
		if(VarsExists=='-1'){ return false; }
		var urlHalves=new Array();
		var k=0;
		var c_empty=true;
		for(var i=0; i<SiteUrlString.length; i++){
			if(SiteUrlString.charAt(i)!='/'){
				if(!urlHalves[k]){ urlHalves[k]=''; }
				urlHalves[k]+=SiteUrlString.charAt(i);
				c_empty=false;
			}else{ 
				if(c_empty==false){ k++; c_empty=true; }
			}//else
		}//for
		
		if(urlHalves[0]=='https:'){ return true; }
		if(urlHalves.length<2){ return true; }
		if(urlHalves.length==2){
			for(var i=0;i<GlobalDomains.length;i++){
				var c_actual='http://'+urlHalves[1];
				if(GlobalDomains[i].name==c_actual){ 
					if(!GlobalDomains[i].startpage || GlobalDomains[i].startpage==''){ return false; }
					var NewURL=GlobalSecureURL; //global data without slash at end
					NewURL+='/'+GlobalDomains[i].startpage;
					document.location=NewURL;
					return true;
				}//if
			}//for
		}//if
		var NewURL=GlobalSecureURL; //global data without slash at end
		for(var i=0;i<urlHalves.length;i++){
			if(urlHalves[i]!='' && i>=2){
				 NewURL+='/'+urlHalves[i];	
			}
		}//for
		document.location=NewURL;
		
	}catch(err){ if(DebugMode==true){ alert('redirectSecure v1.1: '+err); } return false; }
}
/* =============================== redirectSecure [END] ============================= */
