function conf()
{
  if( confirm( 'Are you sure?' ) ) return true
  else return false;
}

function void_()
{
}


function openAWindow( pageToLoad, winName, width, height, center) {
  xposition=0; yposition=0;
  if ((parseInt(navigator.appVersion) >= 4 ) &&(center)) {
   xposition = (screen.width - width) / 2;
   yposition = (screen.height - height) / 2;
  }
  args = "width=" + width + ","
  + "height=" + height + ","
  + "location=0,"
  + "menubar=0,"
  + "resizable=0,"
  + "scrollbars=0,"
  + "status=0,"
  + "titlebar=0,"
  + "toolbar=0,"
  + "hotkeys=0,"
  + "screenx=" + xposition + "," //NN Only
  + "screeny=" + yposition + "," //NN Only
  + "left=" + xposition + "," //IE Only
  + "top=" + yposition; //IE Only
  window.open( pageToLoad, winName, args );
}
function openAWindow2( pageToLoad, winName, width, height, center) {
  xposition=0; yposition=0;
  if ((parseInt(navigator.appVersion) >= 4 ) &&(center)) {
   xposition = (screen.width - width) / 2;
   yposition = (screen.height - height) / 2;
  }
  args = "width=" + width + ","
  + "height=" + height + ","
  + "location=0,"
  + "menubar=0,"
  + "resizable=0,"
  + "scrollbars=1,"
  + "status=0,"
  + "titlebar=0,"
  + "toolbar=0,"
  + "hotkeys=0,"
  + "screenx=" + xposition + "," //NN Only
  + "screeny=" + yposition + "," //NN Only
  + "left=" + xposition + "," //IE Only
  + "top=" + yposition; //IE Only
  window.open( pageToLoad, winName, args );
}

function xget(id) {
	if(document.getElementById) return document.getElementById(id);
	if(document.all) return document.all[id];
	return null;
}

  function makeHttpRequest(url, callback_function, return_xml,nnn) {
	  var http_request = false;

	  if (window.XMLHttpRequest) { // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType && return_xml == 'xml') {
				 http_request.overrideMimeType('text/xml');
			}
	  } else if (window.ActiveXObject) { // IE
			try {
				 http_request = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				 try {
					  http_request = new ActiveXObject("Microsoft.XMLHTTP");
				 } catch (e) {}
			}
	  }

	  if (!http_request) {
			alert('Unfortunately your browser doesn\'t support this feature.');
			return false;
	  }

	  http_request.onreadystatechange = function() {
			if (http_request.readyState == 4) {
				 if (http_request.status == 200) {
					  if (return_xml == 'xml') {
							eval(callback_function + '(http_request.responseXML,\''+nnn+'\')');
					  } else {
							eval(callback_function + '(http_request.responseText,\''+nnn+'\')');
					  }
				 } else {
					  alert('There was a problem with the request. (Code: ' + http_request.status + ')');
				 }
			}
	  }
	  http_request.open('GET', url, true);
	  http_request.send(null);
  }
  
  function getTestimonial(stat,nnn) {
	var obj=document.getElementById('model'+nnn);
	while (obj.options.length>1)
		obj.remove(1);

	obj.options[0]=new Option("Please Wait!!!","");

	obj.selectedIndex=obj.options.length-1;
	obj.disabled=true;  
   makeHttpRequest('/support/checkProduct.asp?id_parent='+stat, 'displayTestimonial', 'text',nnn);
}

function displayTestimonial(text,nnn) {   
	obj=document.getElementById('model'+nnn);
	obj.disabled=false;
	obj.selectedIndex=obj.options.length-1;
	while (obj.options.length>1)
		obj.remove(1);   
	eval(text);		
}

function show_photo(id,id2,k) {   
	if (xget('image_temp') && xget('img_'+k)) {
		close_essay();
		v=xget('img_'+k).src.replace("/thumb110","")
		xget('image_temp').innerHTML='<img src="' + v + '" alt="" border=0 width=640 >';
		for (i=1;i<=5;i++)
		{
			if (xget('img_'+i)) xget('img_'+i).style.border="1px white solid";
		}
		if (xget('img_'+k)) xget('img_'+k).style.border="1px red solid";
	}
}

function show_essay() {   
	if (xget('image_temp') && xget('bio')) {
		xget('image_temp').style.display="none";
		xget('bio').style.display="block";
	}
}

function close_essay() {   
	if (xget('image_temp') && xget('bio')) {
		xget('bio').style.display="none";
		xget('image_temp').style.display="block";
	}
}

function close_detail() {   
	if (xget('detail')) {
		close_essay();
		xget('detail').style.display="none";
	}
}

function show_detail(id) {
   makeHttpRequest('/scholarship_view/getdetail.asp?id='+id+'&rand='+Math.random(), 'displaydetail', 'text',id);
}

function displaydetail(text,id) {
	xget('detail').style.left=(document.body.clientWidth/2-386)+'px';
	eval(text);
}

function vote(id) {
   makeHttpRequest('/scholarship_view/vote.asp?id='+id+'&rand='+Math.random(), 'displayvote', 'text',id);
}

function displayvote(text,id) {
	eval(text);
}
