// JavaScript Document


function checkfun4(id)
 {
 //alert('4'+id);
 var xmlhttp = false;

//Check if we are using IE.
try {
//If the javascript version is greater than 5.
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using IE.
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp = false;
}
}
//If we are using a non-IE browser, create a JavaScript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
  try{
     

        var objID="mediaspace";
		//alert(serverPage);
        var obj = document.getElementById(objID);
    	obj.innerHTML="<iframe width=\"640\" height=\"420\" allowtransparency=\"1\" src=\"/xml_player/test.php?v="+id+"\" frameborder=\"0\" scrolling=\"no\"></iframe>";
        location.href="#top";
        }
catch (e){
        alert("Error on function makeMenuRequest"+e.description);

        }
 }
 
 

function checkfun2(id)
 {
 //alert('2'+id);
 var xmlhttp = false;

//Check if we are using IE.
try {
//If the javascript version is greater than 5.
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using IE.
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp = false;
}
}
//If we are using a non-IE browser, create a JavaScript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
  try{
     

        var objID="mediaspace";
		//alert(serverPage);
        var obj = document.getElementById(objID);
    	obj.innerHTML="<iframe width=\"640\" height=\"420\" allowtransparency=\"1\" src=\"/xml_player/test.php?v="+id+"\" frameborder=\"0\" scrolling=\"no\"></iframe>";
        location.href="#top";
        }
catch (e){
        alert("Error on function makeMenuRequest"+e.description);

        }
 }
 
 
 
  
function checkfun3(mainvcat,vcat,thispage)
 {
// alert('3'+id);
 var xmlhttp2 = false;

//Check if we are using IE.
try {
//If the javascript version is greater than 5.
xmlhttp2 = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using IE.
xmlhttp2 = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp2 = false;
}
}
//If we are using a non-IE browser, create a JavaScript instance of the object.
if (!xmlhttp2 && typeof XMLHttpRequest != 'undefined') {
xmlhttp2 = new XMLHttpRequest();
}
 if (mainvcat=='undefined') {mainvcat=0;}
 if (vcat=='undefined') {vcat=0;}
 if (thispage=='undefined') {thispage=0;}
 
 
  try{
     
	     var serverPage="/xml_player/vcats.php?main_vcat="+mainvcat+"&v_cat="+vcat+"&page="+thispage;
	
        var objID="vcats";
		//alert(serverPage);
        var obj = document.getElementById(objID);
     xmlhttp2.open("GET", serverPage);
        xmlhttp2.onreadystatechange = function() {
                if (xmlhttp2.readyState == 4 && xmlhttp2.status == 200) { //alert(xmlhttp2.responseText);
                        obj.innerHTML = xmlhttp2.responseText;
						//alert(serverPage);
                        }
                }
        xmlhttp2.send(null);
        }
catch (e){
        alert("Error on function makeMenuRequest"+e.description);

        }
 }
 
 
 function submitonEnter(e){ //alert('zzzz');
var keycode = (!e)?window.event.keyCode:e.which;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
if(keycode == "13"){ //alert('aaaaaa');
//document.form1.submit();
dologin(document.login.username.value,document.login.password.value);
}

}



function makeMenuRequest(options){ 
var xmlhttp = false;
//Check if we are using IE.
try {
//If the javascript version is greater than 5.
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using IE.
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp = false;
}
}
//If we are using a non-IE browser, create a JavaScript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}

try{
	var serverPage="/menu/menu.php";	
	var objID="menu";
	var obj = document.getElementById(objID);
	//alert(obj);
	if (options){
		serverPage+="?"+options;
		}
	//alert(serverPage);	
	xmlhttp.open("GET", serverPage);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			obj.innerHTML = xmlhttp.responseText;
			}
		}
	xmlhttp.send(null);	
	}
catch (e){
	alert("Error on function makeMenuRequest"+e.description);
	
	}
}
function openprint(){
	var width=764;
	var height=560;
	window.open ('http://testweb.ctrust.gr/martakis/includes/printable.php',"_blank","top=200,left=200,width="+width+",height="+height+",menubar=0,scrollbars=1,status=0");
}

function reloadCode(){
	
	var oimg=document.getElementById('imgsecurity');
	var url=oimg.src;
	oimg.src=url+"?a=" + new Date();
	
	
}
