var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}
function go(param) {
goexit = (confirm("Confirm?!"));
if (goexit==false){
		return false ;
	}else{
		document.zones.type.value=param;
		document.zones.submit();
	}
}

 function getRequest(sender)
 {
    var xmlHttp = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
    xmlHttp.open('POST', 'image_check.php', true);
    xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
    xmlHttp.onreadystatechange = function()
    {
       if (xmlHttp.readyState == 4 && xmlHttp.status == 200)               
       {
       	//	document.getElementById('teams_img').innerHTML = (xmlHttp.responseText);
       } 
    }
    xmlHttp.send=(sender);
 }
 function getValue(param)
 {
 	var ob =  document.getElementById('img_pass');
 	ob.src = param;
 	//document.getElementById('img_pass').src = param;
 	//alert(param);
    //var postArg = 'obj=' + param;
    //return postArg;
 }
         
         
         
function check_form(param){
	var img_target = document.getElementById(param).value;
	var str = "debel";
	var debel = img_target.substr( img_target.length-15 );
	alert(str.substr(-4,4));
	var is_error = false;
	if(img_target.substr(-4,4)==".gif"){
		is_error = false;
	}
	else if(img_target.substr(-4,4)==".jpg"){
		is_error = false;
	}
	else if(img_target.substr(-4,4)==".JPG"){
		is_error = false;
	}
	else if(img_target.substr(-4,4)==".GIF"){
		is_error = false;
	}
	else if(img_target.substr(-4,4)==".png"){
		is_error = false;
	}
	else if(img_target.substr(-4,4)==".PNG"){
		is_error = false;
	}
	else{
		is_error = true;
	}
	if(is_error){
		alert('Invalid file! Available file type are ".jpg", ".gif" ".JPG", ".GIF"');
		document.getElementById(param).value = '';
	}
	
}

function activate(){
	var ob_status = document.getElementById('agree').checked;
	var ob_text = document.getElementById('offer_read');
	if(ob_status){
		return true;
	}else{
		ob_text.style.color = 'red';
		return false;
	}
		
}
