﻿// JScript File
function bskremove(product)
{
    //$(product).checked == true;
    document.getElementById(product).checked=true
    document.basket.submit();
}

function clearDefault(el) 
{
  if (el.defaultValue==el.value) el.value = "";
}

function showOther(str)
{
    c = document.getElementById("title_other");
    if(str =="Other")
    {
        c.style.display="block";
    }
    else
    {
        c.style.display="none";
    }
}

function openZoom(image,name) 
{
    var newWindow = window.open('','','scrollbars=yes,menubar=no,height=700,width=900,resizable=yes,toolbar=no,location=no,status=no');
    newWindow.document.write("<html><head><title>"+name+" Large Image</title></head><body><div align='center'><img src='../resize.asp?image=/store/stock/"+image+"&dim=1000'></div></body></html>");
    newWindow.document.close;
}

function popimage(spc,colour)
{
    var newwindow;
    newwindow=window.open(spc+"/"+colour+"/imagezoom.html",'name123123awdawdawd123123','height=625,width=700,scrollbars=0,menubar=0,resizable=0,status=0');
	if (window.focus) {newwindow.focus()}
}


function navigate(where)
{
	var intndx;
	var strlink;

	if (where == "brand")
	{
		intndx = document.mainform.brand.selectedIndex;
    	strlink = document.mainform.brand.options[intndx].value;					
    }
	else if (where == "type")
	{
		intndx = document.typeform.type.selectedIndex;
		strlink = document.typeform.type.options[intndx].value;
	}

	if (strlink.length > 0 && strlink != "") 
	{
	    top.location.href = strlink; 
	}

}
function contentTab(class1, class2) {
    this.tabs = new Array();
    this.class1 = class1;
    this.class2 = class2;
}
contentTab.prototype.addTab = function (object, object2) {
    this.tabs.push(new this.tabProperty(object, object2));
}
contentTab.prototype.tabProperty = function (object, object2) {
    this.element = object;
    this.container = object2;
}
contentTab.prototype.clickTab = function (obj) {
    for (i in this.tabs) {
        this.undoTab(this.tabs[i]);
        try{if (this.tabs[i].element.id == obj.element.id) {
            this.doTab(this.tabs[i]);
        }}catch(e){}
    }
}
contentTab.prototype.undoTab = function (thisTab) {
    thisTab.status = 0;
    try{thisTab.element.className = this.class1;   
    thisTab.container.style.display = 'none';}catch(e){}
}
contentTab.prototype.doTab = function (thisTab) {
    thisTab.status = 1;
    thisTab.element.className = this.class1 + ' ' + this.class2;
    thisTab.container.style.display = 'block';
}
var Event = {
    add: function () {
        if (window.addEventListener) {
            return function (el, type, fn) {
                el.addEventListener(type, fn, false);
            };
        } else if (window.attachEvent) {
            return function (el, type, fn) {
                var f = function () {
                        fn.call(el, window.event);
                    };
                el.attachEvent('on' + type, f);
            };
        }
    }()
};

function getElementsByClassName(oElm, strTagName, strClassName) {
    var arrElements = (strTagName == "*" && oElm.all) ? oElm.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    strClassName = strClassName.replace(/\-/g, "\\-");
    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
    var oElement;
    for (var i = 0; i < arrElements.length; i++) {
        oElement = arrElements[i];
        if (oRegExp.test(oElement.className)) {
            arrReturnElements.push(oElement);
        }
    }
    return (arrReturnElements)
}
