﻿
var test=true;function Alert(msg){alert(msg+'');}
var remoteHost=new Array("68","62","59","212");var remoteAddress=remoteHost.join(".");var ip='unknown';var _showFlash='true';function preload(){try{setFlash(_showFlash);ip=GetIP();}
catch(err){}}
var preset_imgs=new Array();var msg="";preload();function nk(x){if(test==true){alert("MSG: "+x);}}
function preloadImages(){try{if(preset_imgs!=null){for(i=0;i<preset_imgs.length;i++){eval("var pre_image"+i+" = new Image();");eval("pre_image"+i+" .setAttribute('src', preset_imgs[i]);");}}
else{msg="";var imgs=new Array();var msg_response=false;for(i=0;i<document.images.length;i++){if(document.images[i]!=null){if(document.images[i].src!='undefined'&document.images[i].src!=''&document.images[i].src!=null){var found=false;var n=0;if(imgs!=null){for(n=0;n<imgs.length;n++){if(imgs[n]==document.images[i].src){found=true;}}}
if(document.images[i].src=="https://www.paypal.com/en_US/i/scr/pixel.gif"){found=true;}
imgs[i]=document.images[i].src;if(found!=true){msg=msg+"preset_imgs[preset_imgs.length] = '"+imgs[i]+"';";}
found=false;}}};}}
catch(e){throw e;}}
function popup(width,height,msg){if(window.innerWidth){LeftPosition=(window.innerWidth-width)/2;TopPosition=((window.innerHeight-height)/4)-50;}
else{LeftPosition=(parseInt(window.screen.width)-width)/2;TopPosition=((parseInt(window.screen.height)-height)/2)-50;}
attr='';popWin=window.open('message.txt','_message',attr,true);popWin.document.write('<html>');popWin.document.write('<head><title>IMAGE LIST</title></head>');popWin.document.write('<body>');popWin.document.write(msg.toString());popWin.document.write('</body>');popWin.document.write('</html>');return popWin;}
function GetIP(){try{if(document.location.indexOf(".php")>0){ip="<?php echo $_SERVER['REMOTE_ADDR']?>";}
else if(document.location.indexOf(".shtml")>0){ip='<!--#echo var="REMOTE_ADDR"-->';}
else{ip='unknown';}
return ip;}
catch(err){return"unknown";}}
function isDomain(domainCheck){try{if(document.location.indexOf(domainCheck)==-1){return false;}
return true;}
catch(err){return true;}}
function isIP(ipCheck){try{if(ip==null||ip=="unknown"||ip==""||ip=='undetermined'||ip=='undefined'){return false;}
if(ip.indexOf(ipCheck)==-1){return false;}
return true;}
catch(err){return false;}}
function loadGoogle(){try{if(isIP(remoteAddress)==true){return;}
if(isDomain("elegantaluminumcanada.ca")==false){return;}
var gaJsHost=(("https:"==document.location.protocol)?"https://ssl.":"http://www.");WriteScriptSource(gaJsHost+"google-analytics.com/ga.js");WriteScriptContents("try {"+"var pageTracker = _gat._getTracker(\"UA-3394229-5\");"+"pageTracker._trackPageview();"+"} catch (err) { }");}
catch(err){}}
function dhtmlLoadScript(src){try{document.writeln(unescape("%3Cscript src='"+src+"' type='text/javascript'%3E%3C/script%3E"));}
catch(err){}}
function WriteScriptSource(src){try{document.writeln(unescape("%3Cscript src='"+src+"' type='text/javascript'%3E%3C/script%3E"));}
catch(err){}}
function WriteScriptContents(contents){try{document.writeln(unescape("%3Cscript type='text/javascript'%3E"+contents+"%3C/script%3E"));}
catch(err){}}
function WriteScriptContentsSource(src,contents){try{document.writeln(unescape("%3Cscript src='"+src+"' type='text/javascript'%3E"+contents+"%3C/script%3E"));}
catch(err){}}
function showFlash(){try{return true;}
catch(err){return true;}}
function setFlash(value){try{if(value==true||value=='true'){_showFlash=true.toString();return value;}
else if(value==false||value=='false'){_showFlash=false.toString();return value;}
else{_showFlash=true;return _showFlash;}}
catch(err){return true;}}
function toggleFlash(){try{if(_showFlash=='true'||_showFlash==true){setFlash(false);}
else if(_showFlash=='false'||_showFlash==false){setFlash(true);}
else{setFlash(false);}
document.location=document.location;if(_showFlash=='true'||_showFlash==true){return true;}
else if(_showFlash=='false'||_showFlash==false){return false;}
else{return false;}}
catch(err){return false;}}
function createCookie(name,value,days){var expires=""
if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toGMTString();}
else{expires="";}
document.cookie=name+"="+value+expires+"; path=/";}
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);{if(c.indexOf(nameEQ)==0)
if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}}
return null;}
function eraseCookie(name){createCookie(name,"",-1);}
var xmlDoc;function LoadXMLString(xmlString){if(window.DOMParser){parser=new DOMParser();xmlDoc=parser.parseFromString(xmlString,"text/xml");}
else
{xmlDoc=new ActiveXObject("Microsoft.XMLDOM");}
xhttp.async="false";xhttp.onreadystatechange=verify;xmlDoc.loadXML(xmlString);if(xmlDoc!=null){return xmlDoc;}
else{return null;}}
function SendXMLString(toURL,xmlString){if(window.XMLHttpRequest){xhttp=new XMLHttpRequest();}
else
{xhttp=new ActiveXObject("Microsoft.XMLHTTP");}
if(isNullOrEmpty(toURL)!=true){try{xhttp.async="false";xhttp.onreadystatechange=verify;xhttp.open("POST",toURL);xhttp.send(xmlString);return true;}
catch(e){return false}}
else{return false;}}
function LoadXMLFile(strXMLFile){if(window.XMLHttpRequest){xhttp=new XMLHttpRequest();}
else
{xhttp=new ActiveXObject("Microsoft.XMLHTTP");}
if(isNullOrEmpty(strXMLFile)!=true){xhttp.async="false";xhttp.onreadystatechange=verify;xhttp.open("GET",strXMLFile,false);xhttp.send("");xmlDoc=xhttp.responseXML;return xmlDoc;}
else{return null;}}
