function searchCountry(base, country) {
    var prefix = "?";
    var uri = base;

    if (country != null && country != "" && country != "0") {
        uri = uri + prefix + "country=" + country;
        prefix = "&";
    }
    window.location = uri;
}

function searchCatalog(base, catalog) {
    var prefix = "?";
    var uri = base;

    if (catalog != null && catalog != "" && catalog != "0") {
        uri = uri + prefix + "catalog=" + catalog;
        prefix = "&";
    }
    window.location = uri;
}

function searchData(base, catalog, sortCompany) 
{
    var prefix = "?";
    var uri = base;

    if (catalog != null && catalog != "" && catalog != "0") {
        uri = uri + prefix + "catalog=" + catalog;
        prefix = "&";
    }
    if (sortCompany != null && sortCompany != "" && sortCompany != "0") {
        uri = uri + prefix + "sortCompany=" + sortCompany;
        prefix = "&";
    }
   
    window.location = uri;
}

/*function joinEmail()
{

if($('press_releases1').checked == true)
{
    $('confirmToEmail').value = ($('toEmail').value+','+$('fromEmail').value);
    //alert($('confirmToEmail').value);
    //alert(20)
}
else
{
    $('confirmToEmail').value = ($('toEmail').value);
}

return true;
}*/



// Source: CodeFoot.com
// Save HTML -- Start
var isReady = false;

function doSaveAs()
    {
        if (document.execCommand)
        {
            if (isReady)
            {
                document.execCommand("SaveAs");
            }
        }
        else
        {
            alert('Feature available only in Internet Exlorer 4.0 and later.');
        }
}
// Save HTML -- End

//Change StyleSheet -- Start
function setFontImage(name) {
    //alert(name);
    $$('.fonts_img').each(function(item)
    {
        if (item.name == name) {
            if (item.readAttribute('over') != '') {
                item.src = item.readAttribute('over');
            } else if (item.readAttribute('out') != '') {
                 item.src = item.readAttribute('out');
           } else if (item.readAttribute('image') != '' ){
                item.src = item.readAttribute('image');
           }
        } else {
            if (item.readAttribute('out') != '') {
                item.src = item.readAttribute('out');
           } else if (item.readAttribute('image') != '' ){
                item.src = item.readAttribute('image');
           }
        }
        
    });
    YAHOO.util.Cookie.set("fontimg_en", name);
}

function setActiveStyleSheet(title) {
    var i, a, main;
    for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
        if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
            a.disabled = true;
            if (a.getAttribute("title") == title) {
                a.disabled = false;
                YAHOO.util.Cookie.set("fontcss_en", title);
            }
        }
    }
}

function getActiveStyleSheet() {
    var i, a;
    for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
        if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
    }
    return null;
}

function getPreferredStyleSheet() {
    var i, a;
    for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
        if (a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
    }
    return null;
}

function createCookie(name, value, days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
        var 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) return c.substring(nameEQ.length, c.length);
    }
    return null;
}

window.onload = function(e) {
    var cookie = readCookie("style");
    var title = cookie ? cookie : getPreferredStyleSheet();
    setActiveStyleSheet(title);
}

window.onunload = function(e) {
    var title = getActiveStyleSheet();
    createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);
//Change StyleSheet -- End

function open_win_pdf(url, pdf_n) {
    Window2 = open("", pdf_n, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=600,height=600');
    if (Window2 != null) {
        if (Window2.opener == null) {
            Window2.opener = self;
        }
        Window2.location.href = url;
        if (Window2.focus) Window2.focus();
    }
}

/*
Header Information------------------------------------[Do Not Remove This Header]--
Title: OO Dom Image Rollover
Description: This script makes it easy to add rollover/ mousedown 
effects to any image on the page, including image submit buttons. Automatically 
preloads images as well. Script works in all DOM capable browsers- IE5+, NS6+, 
Opera7+.
	
Legal: Copyright 2005 Adam Smith
Author Email Address: ibulwark@hotmail.com
Date Created: June 6, 2005
Website: Codevendor.com | eBadgeman.com
Script featured on Dynamic Drive: http://www.dynamicdrive.com
-----------------------------------------------------------------------------------
*/

function imageholderclass() {
    this.over = new Array();
    this.down = new Array();
    this.src = new Array();
    this.store = store;

    function store(src, down, over) {
        var AL = this.src.length;
        this.src[AL] = new Image(); this.src[AL].src = src;
        this.over[AL] = new Image(); this.over[AL].src = over;
        this.down[AL] = new Image(); this.down[AL].src = down;
    }
}

var ih = new imageholderclass();
var mouseisdown = 0;

function preloader(t) {
    for (i = 0; i < t.length; i++) {
        if (t[i].getAttribute('srcover') || t[i].getAttribute('srcdown')) {

            storeimages(t[i]);
            var checker = '';
            checker = (t[i].getAttribute('srcover')) ? checker + 'A' : checker + '';
            checker = (t[i].getAttribute('srcdown')) ? checker + 'B' : checker + '';

            switch (checker) {
                case 'A': mouseover(t[i]); mouseout(t[i]); break;
                case 'B': mousedown(t[i]); mouseup2(t[i]); break;
                case 'AB': mouseover(t[i]); mouseout(t[i]); mousedown(t[i]); mouseup(t[i]); break;
                default: return;
            }

            if (t[i].src) { t[i].setAttribute("oldsrc", t[i].src); }
        }
    }
}
function mouseup(t) {
    var newmouseup;
    if (t.onmouseup) {
        t.oldmouseup = t.onmouseup;
        newmouseup = function() { mouseisdown = 0; this.src = this.getAttribute("srcover"); this.oldmouseup(); }

    }
    else { newmouseup = function() { mouseisdown = 0; this.src = this.getAttribute("srcover"); } }
    t.onmouseup = newmouseup;
}

function mouseup2(t) {
    var newmouseup;
    if (t.onmouseup) {
        t.oldmouseup = t.onmouseup;
        newmouseup = function() { mouseisdown = 0; this.src = this.getAttribute("oldsrc"); this.oldmouseup(); }
    }
    else { newmouseup = function() { mouseisdown = 0; this.src = this.getAttribute("oldsrc"); } }
    t.onmouseup = newmouseup;
}

function mousedown(t) {
    var newmousedown;
    if (t.onmousedown) {
        t.oldmousedown = t.onmousedown;
        newmousedown = function() { if (mouseisdown == 0) { this.src = this.getAttribute("srcdown"); this.oldmousedown(); } }
    }
    else { newmousedown = function() { if (mouseisdown == 0) { this.src = this.getAttribute("srcdown"); } } }
    t.onmousedown = newmousedown;
}

function mouseover(t) {
    var newmouseover;
    if (t.onmouseover) {
        t.oldmouseover = t.onmouseover;
        newmouseover = function() { this.src = this.getAttribute("srcover"); this.oldmouseover(); }
    }
    else { newmouseover = function() { this.src = this.getAttribute("srcover"); } }
    t.onmouseover = newmouseover;
}

function mouseout(t) {
    var newmouseout;
    if (t.onmouseout) {
        t.oldmouseout = t.onmouseout;
        newmouseout = function() { this.src = this.getAttribute("oldsrc"); this.oldmouseout(); }
    }
    else { newmouseout = function() { this.src = this.getAttribute("oldsrc"); } }
    t.onmouseout = newmouseout;
}

function storeimages(t) {
    var s = (t.getAttribute('src')) ? t.getAttribute('src') : '';
    var d = (t.getAttribute('srcdown')) ? t.getAttribute('srcdown') : '';
    var o = (t.getAttribute('srcover')) ? t.getAttribute('srcover') : '';
    ih.store(s, d, o);
}

function preloadimgsrc() {
    if (!document.getElementById) return;
    var it = document.getElementsByTagName('IMG');
    var it2 = document.getElementsByTagName('INPUT');
    preloader(it);
    preloader(it2);
}

if (window.addEventListener) { window.addEventListener("load", preloadimgsrc, false); }
else {
    if (window.attachEvent) { window.attachEvent("onload", preloadimgsrc); }
    else { if (document.getElementById) { window.onload = preloadimgsrc; } }
}

function showhide(num, p_totcount) {
    for (var i = 1; i <= p_totcount; i++) {
        menu = eval("document.getElementById('block" + i + "').style");

        if (num == i) {
            if (menu.display == "block")
            { menu.display = "none"; }

            else
            { menu.display = "block"; }

        }

        else {
            menu.display = "none";
        }
    }
}

function showsubhide(num, p_totcount) {
    for (var i = 1; i <= p_totcount; i++) {
        menu = eval("document.getElementById('tab" + i + "').style");

        if (num == i) {
            if (menu.display == "block")
            { menu.display = "none"; }

            else
            { menu.display = "block"; }

        }

        else {
            menu.display = "none";
        }
    }
} 