﻿/// <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 refreshTotalisator()
{
    var basket = $find('ctl00_BasketTotalisator');
    if (basket == null) basket = $find('ctl00_ctl00_BasketTotalisator');
    
    if (basket != null)
        basket.refresh();
}

function refreshNotepadTotalisator() {
    var notepad = $find('ctl00_NotepadTotalisator');
    if (notepad == null) notepad = $find('ctl00_ctl00_NotepadTotalisator');

    if (notepad != null)
        notepad.refresh();
}

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 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;
}