﻿//  Javascript Common Runtime Script
//  --------------------------------




function showPleaseWait() {
    document.getElementById('PleaseWait').style.display = 'block';
}

function generate_i18n_menu() {
    $('localizationBar').style.display='block';
    var accMenu = new Accordion($$('.main_i18n'), 
						         $$('#localizationBar'), 
						         { start:'close-all',
						           opacity: false,
						           duration: 500,
						           alwaysHide: true,
						           onActive: function(toggler, element){ },
						           onBackground: function(toggler, element){ }
						         }, $('siteLocalization'));
}	//	END FUNCTION

function scrollToLeft() {
	if (parseInt(scrollerContainer.style.left) > -maxOffset) {
		scrollerContainer.style.left=(parseInt(scrollerContainer.style.left)-65) +"px";
	}
}

function scrollToRight() {
	if (parseInt(scrollerContainer.style.left) < 0) {
		scrollerContainer.style.left = parseInt(scrollerContainer.style.left) + 65+"px";
	}        
}

function scrollToTop() {
	if (parseInt(scrollerContainer2.style.top) > -maxOffset2) {
		scrollerContainer2.style.top = parseInt(scrollerContainer2.style.top) - 65+"px";
	}
}

function scrollToBottom() {
    if (parseInt(scrollerContainer2.style.top) < 0) {
		scrollerContainer2.style.top=parseInt(scrollerContainer2.style.top)+ 65 +"px";
	}       
}

function beginNewsLetterSubscription(typeOfSubscription) {
    closeEditor();
    createPopupWidget('SubscriptionForm.aspx', 'typo=' + typeOfSubscription); return false;
}

function beginSubscription(type, fname, mname, lastname, mobile, email, country) {
    var params = type + ";" + fname + ";" + mname + ";" + lastname + ";" + mobile + ";" + email + ";" + country;
    closeEditor();
    
    createPopupWidget('FinalizeSubscription.aspx', 'params=' + params); return false;
}
		
function setCookie(c_name,value,expiredays) {
    var exdate=new Date();
    exdate.setDate(exdate.getDate()+expiredays);
    document.cookie=c_name+ "=" +escape(value)+
    ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name)
    {
    if (document.cookie.length>0)
      {
      c_start=document.cookie.indexOf(c_name + "=");
      if (c_start!=-1)
        {
        c_start=c_start + c_name.length+1;
        c_end=document.cookie.indexOf(";",c_start);
        if (c_end==-1) c_end=document.cookie.length;
        return unescape(document.cookie.substring(c_start,c_end));
        }
      }
    return "";
    }