﻿function setFocus(sId) 
{
	document.getElementById(sId).focus();
}

function setDivShow(sId) 
{
	document.getElementById(sId).style.display="block"; 
}

function setDivHide(sId) 
{
	document.getElementById(sId).style.display="none"; 
}
addEvent(window, 'load', function() {
    var input;
    var inputs = document.getElementsByTagName('input');
    for (var i = 0; (input = inputs[i]); i++) {        
        if(input.type=='text')
        {
            addEvent(input, 'focus', oninputfocus);
            addEvent(input, 'blur', oninputblur);
        }
    }
    /*var selects = document.getElementsByTagName('select');
    for (var i = 0; (select = selects[i]); i++) {
        addEvent(select, 'focus', oninputfocus);
        addEvent(select, 'blur', oninputblur);
    }*/
});

function oninputfocus(e) {
    /* Cookie-cutter code to find the source of the event */
    if (typeof e == 'undefined') {
        var e = window.event;
    }
    var source;
    if (typeof e.target != 'undefined') {
        source = e.target;
    } else if (typeof e.srcElement != 'undefined') {
        source = e.srcElement;
    } else {
        return;
    }
    /* End cookie-cutter code */
//    source.style.border='1px solid #666';
    //source.style.background='#F0E68C';
    source.style.background='#ffd600';
}
function oninputblur(e) {
    /* Cookie-cutter code to find the source of the event */
    if (typeof e == 'undefined') {
        var e = window.event;
    }
    var source;
    if (typeof e.target != 'undefined') {
        source = e.target;
    } else if (typeof e.srcElement != 'undefined') {
        source = e.srcElement;
    } else {
        return;
    }
    /* End cookie-cutter code */
//    source.style.border='1px solid #000';
    source.style.background='#FFF';
}
function addEvent(obj, evType, fn){
    if (obj.addEventListener){
        obj.addEventListener(evType, fn, true);
        return true;
    } else if (obj.attachEvent){
        var r = obj.attachEvent("on"+evType, fn);
        return r;
    } else {
        return false;
    }
}
function loadcartgrid()
{
    var browserName=navigator.appName; 
          
    if(browserName=="Microsoft Internet Explorer" || browserName=="Firefox")
    {
        window.location.href=window.location.href; 
    }else{
        if(browserName=="Netscape"){
            window.location=window.location;  
        }else{
            window.location.href=window.location.href;   
            }
        }
}
sfFocus = function() {
	var sfEls = document.getElementsByTagName("A");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onfocus=function() {
			this.className+=" sffocus";
		}
		sfEls[i].onblur=function() {
			this.className=this.className.replace(new RegExp(" sffocus\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfFocus);

if (top.location != self.location) {
	top.location.href = self.location.href;
}

function setLinkCss(){

    if (screen.width == 1024){
        document.write('<link rel=stylesheet type="text/css" href="/css/anylinkvertical.css">');
    }else{
        if (screen.width == 800){
            document.write('<link rel=stylesheet type="text/css" href="/css/anylinkvertical800.css">');
        }else{
            if (screen.width == 1152){
                document.write('<link rel=stylesheet type="text/css" href="/css/anylinkvertical.css">');
            }else{
                if (screen.width == 1280){
                    document.write('<link rel=stylesheet type="text/css" href="/css/anylinkvertical1280.css">'); 
                }else{
                    if (screen.width == 1360){
                    document.write('<link rel=stylesheet type="text/css" href="/css/anylinkvertical1360.css">'); 
                }else{
                    document.write('<link rel=stylesheet type="text/css" href="/css/anylinkvertical.css">') ;
                    }
                }
            }
        }
    }
}

