function toggleDisplayStyle(elId) {
	el = self.document.getElementById(elId);
	if (el) {
		el.style.display = (el.style.display == 'block') ? 'none' : 'block';
	}
}

function showPrices(uri_prices) {
    var win = window.open(uri_prices, "Prices", "width=1000,height=360,left=10,top=20");
    win.focus();
}

function printTC(targetId) {
   document.getElementById(""+targetId+"").contentWindow.focus();
   document.getElementById(""+targetId+"").contentWindow.print();
}

function showCRSTool(){
   document.getElementById("CRSTool").style.display = "block";
}
    

function hideCRSTool(){
   document.getElementById("CRSTool").style.display = "none";
}

function showText(uri_text) {
    var win = window.open(uri_text, 'ptsText', 'top=50,left=50,width=480,height=480,scrollbars=1,resizable=1,menubar=1');
    win.focus();
}

function handleNonAcceptanceTermAndConditions(i18nMessage) {
    var answer = confirm(i18nMessage);
    if(answer) {
        window.location = "http://www.pegs.com/";
    } else {
    //stay there
    }
}

// TODO: check if functions below are used

function openScreen (url) {
  var win = window.open(url, "Test", "width=300,height=400,left=100,top=200");
  win.focus();
}
function unsubscribeConfirmation(i18nMessage,subscriptionId) {
    var answer = confirm(i18nMessage);
	if(answer){
		//alert('index.php?action=disableLanguage&language='+languagecode+'&subscriptionId='+subscriptionId);
        window.location = "index.php?action=endSubscription&subscriptionId="+subscriptionId;
	} else{
	// stay there
	}
}
function languageDropConfirmation(i18nMessage, languagecode, subscriptionId) {
    var answer = confirm(i18nMessage);
	if(answer){
		//alert('index.php?action=disableLanguage&language='+languagecode+'&subscriptionId='+subscriptionId);
        window.location = "index.php?action=disableLanguage&language="+languagecode+"&subscriptionId="+subscriptionId;
	} else{
	// stay there
	}
}

function handleTicketSubject(formElement) {
	formElements = document.forms.newTicket.elements;
	subjectArr = new Array;
	if (formElements['ticket[brandCode]'].value != '') {
		subjectArr.push(formElements['ticket[brandCode]'].value);
	}
	if (formElements['ticket[propertyId]'].value != '') {
		subjectArr.push(formElements['ticket[propertyId]'].value);
	}
	formElements['ticket[subject]'].value = subjectArr.join(' ');
}

