﻿/// <reference name="MicrosoftAjax.js"/>
	
/* JavaScript file for SIP common */

function printDetails()
{
    window.print();
}

function printProductDetails(URL, ProductNumber) {
    var win = window.open(URL + '?ProductNumber=' + ProductNumber, "Print", "width=600,height=400,toolbar=no,menubar=no");
    if (win != null)
        win.focus();
}

function printNotepad(NotepadID)
{
    var win = window.open('NotepadPrint.aspx?ID=' + NotepadID,"Print","width=650,height=400,toolbar=no,menubar=no,scrollbars=yes");
    if (win != null) {
        win.focus();
    }
}

function setUniqueRadioButton(current, nameregex)
{      
    var re = new RegExp('.*' + nameregex);
    for (i = 0; i < document.forms[0].elements.length; i++)
    {
        elm = document.forms[0].elements[i];
        if (elm.type == 'radio')  
        {        
            if (re.test(elm.name))
            {       
                elm.checked = false;
            }    
        }
    }

    current.checked = true;
}

function clearSearch(sender)
{
    if (sender.value == 'Suche' ||
        sender.value == 'zoeken' ||
        sender.value == 'Search')
        sender.value = '';
}

function checkSearch(sender) {
    var textBox = $get(sender.id.replace(/ImageButtonSearch/, 'TextBoxSearch'));
    if (textBox.value == 'Suche' ||
        textBox.value == 'zoeken' ||
        textBox.value == 'Search') {
        textBox.value = '';
        textBox.focus();

        return false;
    }

    return true;
}

function imageRightClick() {
    alert('This image is copyright protected by SIP Scootershop GmbH, Landsberg am Lech. No useage, privat or for business is allowed. All useage will be followed by our lawyer.\nDiese Abbildung ist Urhebergeschützt und Eigentum der SIP Scootershop GmbH, Landsberg am Lech. Keine Verwendung, privat oder gewerblich, ist gestattet. Jeder Missbrauch wird zur Anzeige gebracht');
    return false;
}
