function apiRequest(details, onSuccess, onError, valueString) // user defined function for ajax with jQuery
{
	$.ajax({
		url: details.url, dataType: "html", type: details.type, data: details.string, cache: details.cache,
		success: function(data){
			if(onSuccess == null){ return; }
			onSuccess(data, valueString);
		},
		error: function(data){
			if(onError == undefined)
			alert("Could not load the page."); return;
			onError(data);
		}
	});
}
function apiOpen(data, val) // displaying popup 
{
	$("body").css("overflow","hidden");
	$.modal(data,{ onClose: function(dialog) { apiClose(); } });
}
function apiClose() // to close dialog box
{
	$.modal.close();
	$("body").css("overflow","visible");
}

function submittickets() // opens popup for admintrash.php
{
	apiRequest({ url:"submitticket.php", type: "GET", string: null, cache: true }, apiOpen, null, null);
}
function openwin(a) // opens popup for admintrash.php
{
	apiRequest({ url:"countrywindow.php?cnt_id="+a, type: "GET", string: null, cache: true }, apiOpen, null, null);
}
function newsPop() // opens popup for news_latest.php
{
	apiRequest({ url:"latest_news.php", type: "GET", string: null, cache: true }, apiOpen, null, null);
}
function leadtickets() // opens popup for admintrash.php
{
	apiRequest({ url:"leadticket.php", type: "GET", string: null, cache: true }, apiOpen, null, null);
}
// registration restricted countries addresses POP-UP
function chechcntry123(a){
	var a = document.getElementById("country").value;
	if(a==72 || a==195 || a==203 ||  a==222){ 
		openwin(a);
		document.getElementById("country").value="";
		return false;
	}
}

