function changeMenu(id,id2) {
if(id>0)
	{
	identity3=document.getElementById(id);
	identity3.className='qm-startopen';
	}
if(id2.length>0)
	{
	identity4=document.getElementById(id2);
	identity4.style.color='#ffd200';
	identity4.style.fontWeight='bold';
    } 
}
function NewWindow(mypage, myname, w, h, scroll, resizable) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resizable
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) {win.window.focus(); }
}

function emptyInputTextDibo(object) {
	if( object.value == $(object).attr("title")) object.value="";
      else if( object.value == "") object.value=$(object).attr("title");
}

function emptyInputText(inputObject, emptyText) {
	if(inputObject.value == emptyText) inputObject.value="";
	else if(inputObject.value == "") inputObject.value=emptyText;
}
function createRequestObject(){
	var req = false;
  	
	if(window.XMLHttpRequest){
		req = new XMLHttpRequest();
		
		if(req.overrideMimeType){ req.overrideMimeType('text/xml'); }
	} 
	else if(window.ActiveXObject){
		try{ req = new ActiveXObject("Msxml2.XMLHTTP"); }
		catch(e){
			try{ req = new ActiveXObject("Microsoft.XMLHTTP"); }
			catch(e){}
		}
	}
	if(!req){
		alert("Error: Your browser does not support AJAX");
		return false;
	}
	else { 
	   return req; 
	}	
}

function incJsFile(filename)
{
var body = document.getElementsByTagName('body').item(0);
script = document.createElement('script');
script.src = filename;
script.type = 'text/javascript';
body.appendChild(script)
}

function gotoNextDate(path,monthcal,yearcal) {
	srchev = document.getElementById('trainingCalendarSelect').value;
	var req = false;
	 req = createRequestObject();
	 if(req){		   
	    req.open("GET", path+"/calendar/view.php?month=" + monthcal + "&year="+yearcal+"&idsrchevcategory="+srchev+"&bustcache="+new Date().getTime(), false);
	    req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
	    req.send(null);
	  }
			
	  if(req.readyState == 4){
	    if(req.status == 200){
		 var contentcalendar = req.responseText;
		 document.getElementById('contentcalendar').innerHTML = contentcalendar;
		 incJsFile(path+'/js/tooltip.js');
	  }
	  else {
		  alert("Not status");
		  return false;
	  }
	 }
	   else {
		 alert("Not state");
		 return false;
	   }
}

$(document).ready(function() {
	
});
