// FLASH FUNCTIONS
var requiredVersion = 5;
var useRedirect = false;
var flashPage = "movie.html"
var noFlashPage = "noflash.html"
var upgradePage = "upgrade.html"
var flash2Installed = false;
var flash3Installed = false;
var flash4Installed = false;
var flash5Installed = false;
var flash6Installed = false;
var flash7Installed = false;
var maxVersion = 7;
var actualVersion = 0;
var hasRightVersion = false;
var jsVersion = 1.0;
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;
jsVersion = 1.1;
if(isIE && isWin){
document.write(' \n');
document.write('on error resume next \n');
document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
document.write(' \n');
}
function detectFlash() {
if (navigator.plugins) {
if (navigator.plugins["Shockwave Flash 2.0"]
|| navigator.plugins["Shockwave Flash"]) {
var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
flash2Installed = flashVersion == 2;
flash3Installed = flashVersion == 3;
flash4Installed = flashVersion == 4;
flash5Installed = flashVersion == 5;
flash6Installed = flashVersion == 6;
flash7Installed = flashVersion >= 7;
}
}
for (var i = 2; i <= maxVersion; i++) {
if (eval("flash" + i + "Installed") == true) actualVersion = i;
}
if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 3;
if (actualVersion >= requiredVersion) {
if (useRedirect) {
if(jsVersion > 1.0) {
window.location.replace(flashPage);
} else {
window.location = flashPage;
}
}
hasRightVersion = true;
} else {
if (useRedirect) {
if(jsVersion > 1.0) {
window.location.replace((actualVersion >= 2) ? upgradePage : noFlashPage);
} else {
window.location = (actualVersion >= 2) ? upgradePage : noFlashPage;
}
}
}
}
detectFlash();
function writeFlashParam(width, height, flash, alternate, id, map){
if (!useRedirect) {
if(hasRightVersion && flash != "") {
var secStart = 5;
var flashLowerCase = flash.toLowerCase();
if(flashLowerCase.indexOf("movurl") == -1)
{
flashpath = "?secStart=" + secStart + "&movUrl=" + flash.substring(0, flash.lastIndexOf("/")+1);
}
else
{
if(flashLowerCase.indexOf("secStart") == -1)
flashpath = "&secStart=" + secStart;
}
var oeTags = '';
document.write(oeTags);
} else {
if(map != ""){
document.write('
');
}else{
document.write('
');
}
}
}
}
function writeFlashParamNoLoop(width, height, flash, alternate, id, map){
if (!useRedirect) {
if(hasRightVersion && flash != "") {
var secStart = 5;
var flashLowerCase = flash.toLowerCase();
if(flashLowerCase.indexOf("movurl") == -1)
{
flashpath = "?secStart=" + secStart + "&movUrl=" + flash.substring(0, flash.lastIndexOf("/")+1);
}
else
{
if(flashLowerCase.indexOf("secStart") == -1)
flashpath = "&secStart=" + secStart;
}
var oeTags = '';
document.write(oeTags);
} else {
if(map != ""){
document.write('
');
}else{
document.write('
');
}
}
}
}
function writeTransFlashParam(width, height, flash, alternate, id, map){
if (!useRedirect) {
if(hasRightVersion && flash != "") {
var secStart = 5;
var flashLowerCase = flash.toLowerCase();
if(flashLowerCase.indexOf("movurl") == -1)
{
flashpath = "?secStart=" + secStart + "&movUrl=" + flash.substring(0, flash.lastIndexOf("/")+1);
}
else
{
if(flashLowerCase.indexOf("secStart") == -1)
flashpath = "&secStart=" + secStart;
}
var oeTags = '';
document.write(oeTags);
} else {
if(map != ""){
document.write('
');
}else{
document.write('
');
}
}
}
}
function playFlash(id,frame){
if(eval("document." + id)){
if(eval("document." + id + ".TCurrentFrame(\"_level0\")") < 1){
eval("document." + id + ".GotoFrame(" + frame + ")");
}
}
}
// GENERAL FUNCTIONS
function BrowserSystemCheck() {
var brwtype = navigator.appName
if (brwtype=="Netscape") this.brwtype = "ns"
else if (brwtype=="Microsoft Internet Explorer") this.brwtype = "ie"
else this.brwtype = brwtype
this.brwvers = navigator.appVersion
this.brwversion = parseInt(this.brwvers)
this.ns = (this.brwtype=="ns" && this.brwversion>=4)
this.ns4 = (this.brwtype=="ns" && this.brwversion==4)
this.ns6 = (this.brwtype=="ns" && this.brwversion==5)
this.ie = (this.brwtype=="ie" && this.brwversion>=4)
this.ie4 = (this.brwvers.indexOf('MSIE 4')>0)
this.ie5 = (this.brwvers.indexOf('MSIE 5')>0)
}
var is = new BrowserSystemCheck();
var isNav, isIE, isMoz;
var collStart = "";
var collEnd = "";
var styleObj = "";
if (parseInt(navigator.appVersion) >= 4){
if(navigator.appName == "Netscape"){
if(parseInt(navigator.appVersion) >= 5){
isMoz = true;
collStart = "getElementById('";
collEnd = "')";
styleObj = ".style";
}
else{
isNav = true;
}
}
else{
isIE = true;
collStart = "all.";
styleObj = ".style";
}
}
function getObject(obj){
var theObj;
if (typeof obj == "string"){
theObj = eval("document." + collStart + obj + collEnd + styleObj);
}
else{
theObj = obj;
}
return theObj;
}
function shiftTo(obj, x, y){
var theObj = getObject(obj);
if (isNav){
theObj.moveTo(x,y);
}
else if(isMoz){
theObj.left = x;
theObj.top = y;
}
else{
theObj.pixelLeft = x;
theObj.pixelTop = y;
}
}
function getObjectLeft(obj){
var theObj = getObject(obj);
if (isNav){
return theObj.left;
}
else{
return theObj.pixelLeft;
}
}
function getObjectTop(obj){
var theObj = getObject(obj);
if(isNav){
return theObj.top;
}
else if(isMoz){
return theObj.top;
}
else{
return theObj.pixelTop;
}
}
function show(obj){
var theObj = getObject(obj);
if(isNav){
theObj.visibility = "show";
}
else{
theObj.visibility = "visible";
}
}
function hide(obj){
var theObj = getObject(obj);
if (isNav){
theObj.visibility = "hide";
}
else{
theObj.visibility = "hidden";
}
}
var featureId="";
function popup(url,pwidth,pheight){
if(featureId != "") window.open(url+escape(featureId),'print','toolbar=0,menubar=0,location=0,directories=0,status=0,resizable=0,scrollbars=1,HEIGHT='+pheight+',WIDTH='+pwidth);
else window.open(url,'print','toolbar=0,menubar=0,location=0,directories=0,status=1,resizable=0,scrollbars=1,HEIGHT='+pheight+',WIDTH='+pwidth);
}
function popupMenu(url,pwidth,pheight){
window.open(url,'menupage','toolbar=1,menubar=1,location=1,directories=0,status=1,resizable=1,scrollbars=1,HEIGHT='+pheight+',WIDTH='+pwidth);
}
function setFocus(formname,fieldname){
if(eval("document."+formname)) eval("document."+searchForm+"."+fieldname+".focus()");
}
function imgSwap(imgName, newImgSource){
if(is.ns4) eval("document.images['" + imgName + "'].src = " + newImgSource + ".src");
else eval("document.getElementById('" + imgName + "').src = " + newImgSource + ".src");
}
function preload(imgObj,imgSrc){
if(document.images){
eval(imgObj+' = new Image()');
eval(imgObj+'.src = "'+imgSrc+'"');
}
}
function sendErrorMsg(errSpan,fieldName, errMsg){
if(document.getElementById(errSpan)) document.getElementById(errSpan).innerHTML = "
";
if(document.getElementById(fieldName)) document.getElementById(fieldName).className = "txtContentRedHeaderThree";
}
function removeErrorMsg(fieldName){
if(document.getElementById(fieldName)) document.getElementById(fieldName).className = "txtContentHeaderThree";
}
var arrSelected = getCookie("productCompare");
var productitem = 0;
function basketInit(){
arrSelected = getCookie("productCompare");
productitem = 0;
if(arrSelected!="" && arrSelected!=null){
arrSelected = arrSelected.split(",");
if(document.getElementById('spanCompareInfo')){
if(arrSelected.length==0 || arrSelected.length>1) document.getElementById('spanCompareInfo').innerHTML = "You have " +arrSelected.length + " products in your basket";
else document.getElementById('spanCompareInfo').innerHTML = "You have " +arrSelected.length + " product in your basket";
}
productitem = arrSelected.length;
}
else{
arrSelected = [null,null,null,null];
productitem = 0;
if(document.getElementById('spanCompareInfo')){
document.getElementById('spanCompareInfo').innerHTML = "You have 0 products in your basket";
}
}
//alert(arrSelected);
//alert(productitem);
}
function checkForm(pID,status){
if(eval("document.getElementById('productCheck')")){
if(eval("document.getElementById('productCheck').c"+pID)){
if(eval("document.getElementById('productCheck').c"+pID+".checked") == true && status == 0){
checkC(pID,status);
}else{
uncheckC(pID,status);
}
}
else{
uncheckC(pID,status);
}
}
else{
if(status==2) uncheckC(pID,status);
else checkC(pID,status);
}
}
function checkC(pID,status){
if(productitem>=4){
if(eval("document.getElementById('productCheck')")){
if(eval("document.getElementById('productCheck').c"+pID)){
eval("document.getElementById('productCheck').c"+pID).checked = false;
}
}
alert("Only 4 products may be compared at a time.");
}
else{
isSelectedAlready = false;
for(var k=0; k< productitem; k++){
if(pID == arrSelected[k]) isSelectedAlready = true;
}
if(isSelectedAlready){
alert("Already in Basket");
}
else{
arrSelected[productitem++] = pID;
var tmp = "";
for(var i=0; i< productitem; i++){
if(tmp==""){
tmp = arrSelected[i];
}
else{
tmp += "," + arrSelected[i];
}
}
setCookie("productCompare",tmp);
if(document.getElementById('spanCompareInfo')){
if(i==0 || i>1) document.getElementById('spanCompareInfo').innerHTML = "You have " + i + " products in your basket";
else document.getElementById('spanCompareInfo').innerHTML = "You have " + i + " product in your basket";
}
}
}
}
function uncheckC(pID,status){
var found = false;
for(var i=0; i < productitem; i++){
if(arrSelected[i]==pID){
found = true;
if(status !=0){
if(eval("document.getElementById('productCheck')")){
if(eval("document.getElementById('productCheck').c"+pID)) eval("document.getElementById('productCheck').c"+pID).checked = false;
}
}
}
if(found){
arrSelected[i] = arrSelected[i+1];
}
}
arrSelected[productitem--] = null;
var tmp = "";
for(var i=0; i< productitem; i++){
if(tmp==""){
tmp = arrSelected[i];
}
else{
tmp += "," + arrSelected[i];
}
}
//alert(tmp)
setCookie("productCompare",tmp);
if(document.getElementById('spanCompareInfo')){
if(i==0 || i>1) document.getElementById('spanCompareInfo').innerHTML = "You have " + i + " products in your basket";
else document.getElementById('spanCompareInfo').innerHTML = "You have " + i + " product in your basket";
}
}
function compareProducts(){
var strQ = "";
for(i=0; i< productitem; i++){
if(strQ=="") strQ += arrSelected[i];
else strQ += "," + arrSelected[i];
}
if(strQ!="") document.location.href= "node428.asp?Products=" + strQ; //+ "&CategoryID=39" //alert(strQ);
else alert("You must select at least 2 products to compare.");
}
function setCookie(name, value, expires, path, domain, secure)
{
document.cookie= name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
function getCookie(name){
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1){
begin = dc.indexOf(prefix);
if (begin != 0) return null;
}
else{
begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1){
end = dc.length;
}
return unescape(dc.substring(begin + prefix.length, end));
}