
/*
 * Show/hide helptext in input field
 */
function inputHelper(el,val,cursor) 
{
    if (cursor) {
        if (el.value==val)
        el.value="";
    } else {
        if (el.value=="")
        el.value=val;
    }
}


/* 
 * Count glider index previous and next
 * @param: glider id
 * @param: number of pages in pager
 */
 
 
function countPrev(glider, max) 
{
    var currIndex = document.getElementById(glider+'_count').innerHTML;
    if (currIndex == 1)
    {
        currIndex = max;  
    }
    else {
        currIndex--;        
    }
    document.getElementById(glider+'_count').innerHTML =    currIndex;  
}

function countNext(glider, max) 
{
    var currIndex = document.getElementById(glider+'_count').innerHTML;
    if (currIndex == max)
    {
        currIndex = 1;  
    }
    else {
        currIndex++;        
    }
    document.getElementById(glider+'_count').innerHTML =    currIndex;
    
}


/* 
 * Shop: Data page
 * Fieldset shippingfields with input fields for shippingaddress will be shown
 *
 */
 function toggleShipping(state)
 {
    // hide input fields for no shipping address
    if (state == 0)
    {
        document.getElementById('shippingfields').style.display = 'none';      
    }
    // show input fields for selected shipping address
    else if (state == 1)
    {
        document.getElementById('shippingfields').style.display = 'block';      
    }

 }
 
 
 

/* 
 * Shop: Payment page
 * Fieldset id=elvfields with input fields for elv will be shown
 * if radiobutton elv is clicked (default) or hidden if
 * radiobutton vk is clicked
 *
 */
 function togglePayment(type)
 {
    // hide input fields for payment type 'vk'
    if (type == 'vk')
    {
        document.getElementById('elvfields').style.display = 'none';
    }
    // show input fields for payment type 'elv'
    else if (type == 'elv')
    {
        document.getElementById('elvfields').style.display = 'block';
    }

 }
 
 
/* 
 * Register step 3 (deluxe)
 * Show deluxe form and infotext onclick
 *
 */
 function toggleDeluxeInfo(element)
 {
        if (element.checked)
        {
            document.getElementById('deluxeForm').style.display = 'block';      
            document.getElementById('deluxeText').style.display = 'block';      
        }
        else if (!element.checked)
        {
            document.getElementById('deluxeForm').style.display = 'none';          
            document.getElementById('deluxeText').style.display = 'none';          
        }

 }
 
  
 
 
/* 
 * Opens popup for AGB
 */ 
function popupAgb(url) {
    var popupWin = window.open(url,'AGB','left=100,top=10,width=600,height=490,location=no,scrollbars=no,resizable=no,directories=no,status=no,toolbar=no,menubar=no');
    popupWin.focus();
    return false;


} 
 
/* 
 * Opens popup for Deluxe-AGB
 */ 
function popupDeluxeAgb(url) {
    var popupWin = window.open(url,'AGB','left=100,top=10,width=600,height=490,location=no,scrollbars=no,resizable=no,directories=no,status=no,toolbar=no,menubar=no');
    popupWin.focus();
    return false;


} 
  
 
/* 
 * Opens the popup for the Video-Comment
 */ 
function popupVideocomment(url, commentid) {
    var popupVideo = window.open(url + '?id=' + commentid,'Kommentar','left=200,top=10,width=495,height=490,location=no,scrollbars=no,resizable=no,directories=no,status=no,toolbar=no,menubar=no');
    popupVideo.focus();
    return false;
} 
 
 
/* 
 * Opens a popup for a video (profileblog))
 */ 
function popupVideo(url, blogid) {
    var popupVideo = window.open(url + '?id=' + blogid,'Video','left=200,top=10,width=495,height=490,location=no,scrollbars=no,resizable=no,directories=no,status=no,toolbar=no,menubar=no');
    popupVideo.focus();
    return false;
} 
 

 
  
 
 
 
 
 
 
 