
function open_popup_window(url, x, y) {
	window.open(url,"js_window","width="+x+",height="+y+",dependent=yes,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,status=no,location=no,top=90,left=110");
}
function open_popup(url) {
	window.open(url,"js_window","width=600,height=400,dependent=yes,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,status=no,location=no,top=90,left=110");
}

var tempString = unescape(location.href);
var	url;
if (tempString.indexOf('?')!=-1) {
	url = tempString.substr(0,tempString.indexOf('?'));
}else
url = tempString;

function GetXmlHttpObject(){
	var xmlHttp = null;
	try{
	 // Firefox, Opera 8.0+, Safari
	 xmlHttp=new XMLHttpRequest();
	}
	catch (e){
	// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e){
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
function SendReq(url, element){
	var req = GetXmlHttpObject();
	//ShowLoadingBox(element);
	loadAnimationStart();
	window.status='loading';
	req.onreadystatechange = function(){
		if(req.readyState == 4 && req.status == 200) {
			if (element != ""){
				response = req.responseText;
		    	document.getElementById(element).innerHTML = response;
			}
			//HideLoadingBox(element);
			loadAnimationStop();
	    }
    }
    req.open("GET", url, true);
    req.send(null);

}


function sendRequest(url,id,parent_id,method){
	if (method == null) {
		method = "GET";
	}


	var req = GetXmlHttpObject();

	$('#'+parent_id).height($('#'+id).height());

	$('#'+id).fadeOut();
	window.status='loading';
	req.onreadystatechange = function(){
		if(req.readyState == 4 && req.status == 200) {
			if (id != ""){
				response = req.responseText;
					document.getElementById(id).innerHTML = response;
			}
				$('#'+parent_id).height('');
		$('#'+id).fadeIn();
	    }
    }

    req.open("GET", url, true);
    req.send(null);

}

function ajax(url,el){

	element = 'test';
	var req = GetXmlHttpObject();


	$('#moduleShout').height($('#test').height());
	$('#test').fadeOut();
	window.status='loading';
	req.onreadystatechange = function(){
		if(req.readyState == 4 && req.status == 200) {
			if (element != ""){
				response = req.responseText;
		    	document.getElementById(element).innerHTML = response;
			}
				$('#moduleShout').height('');
		$('#test').fadeIn();
			loadAnimationStop();
	    }
    }
    req.open("GET", url, true);
    req.send(null);
}


function imgEfecgt(el){
	document.getElementById(el).innerHTML ='';
	var div = document.createElement("div");
	div.setAttribute("id","blocking_div"+el);
	div.innerHTML = '<img  src="i/logo_loader.gif" style="margin:0"/>';
	document.getElementById(el).appendChild(div);
}
function ShowLoadingBox(el){

	$("#"+el).fadeOut(1000);

}

function HideLoadingBox(el){

		$("#"+el).fadeIn('fast');
}

function showDiv(id){
	document.getElementById(id).style.display = 'block';
}


function removeDiv(id){
	document.getElementById(id).style.display = 'none';
		document.getElementById(id).innerHTML = '';
}


function  getDayEvents(date){

}


function hideDiv(id){
	document.getElementById(id).style.display = 'none';
}

$(document).ready(function(){

	$('a').click(function(){
	if (!$(this).hasClass('http')) {


	if ($(this).attr('href').substr(0,4)=='www') {
		window.open($(this).attr('href'),'_blank');
		return false;
	}

	if ($(this).attr('href').substr(0,4)!='http') {
	//	loadAnimationStart();
	}else{
		window.open($(this).attr('href'),'_blank');
		return false;
	}
	}
	});



});


