// JavaScript Document. Created by adfasa
/*
am = "This function is disabled!";
bV  = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"

function nrc(e) {
   if (bNS && e.which > 1){
      alert(am)
      return false
   } else if (bIE && (event.button >1)) {
     alert(am)
     return false;
   }
}

document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV<5) window.onmousedown = nrc;
*/

/*#################### START ###################3*/
function ajaxConnect()
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
return xmlHttp;
}
function makeRequest(url, container)
{

var http_request = false;
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) {
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Giving up :( Cannot create an XMLHTTP instance');
return false;
}
http_request.onreadystatechange = function() { alertContents(http_request, container) };
//url = url + '&rand = ' + parseInt(Math.random()*999999999999999);
url = url;
http_request.open('GET', url, true);
http_request.send(null);
}

function alertContents(http_request, container)
{
if (http_request.readyState == 4)
{
if (http_request.status == 200)
{
document.getElementById(container).innerHTML=http_request.responseText;
}
else
{
alert("Problem");
}

}
else
{
document.getElementById(container).innerHTML = '<div style="height:220px; margin-top:100px; width:100%" align="center"><img src="images/ajax-loader.gif"></div>';
}
}

function CheckAll(Frm, ctlName)
{
	for (var i=0; i<Frm.elements.length; i++) 
	{
		var e = Frm.elements[i];
		
		if(e.type=='checkbox')
		e.checked = 'checked';
	}
}

function starOver(id, objid){
	var name;
	for(i=1; i <= id; i++){
		name = 'star'+i+objid;
		document.getElementById(name).src='images/mini/yrStar.gif';
	}
}
function starOut(id, objid){
	var name;
	for(i=1; i <= id; i++){
		name = 'star'+i+objid;
		document.getElementById(name).src='images/mini/crayStar.gif';
	}
}
function starFullOut(rate, objid){
	var name;
	for(i=1; i <= 5; i++){
		name = 'star'+i+objid;
		if(i<=rate)
		document.getElementById(name).src='images/mini/yrStar.gif';
		else
		document.getElementById(name).src='images/mini/crayStar.gif';
	}
}
function setFocus(name){
	document.getElementById(name).select();
	document.getElementById(name).focus();
}


/*   ****** BamDaa ****** */

/****** VERTIVAL MENU ******/

function setMenuColor($elementId, $event)
	{		
	var $element=document.getElementById($elementId);	
	if($event=='over')
			if($element.className != 'HorzMainMenuActive')
				{
				$element.style.backgroundColor = '#4297ef';
				$element.style.color='white';
				}
		
	if($event=='out')		
			if($element.className!='HorzMainMenuActive')
				{
				$element.style.backgroundColor = "#FFFFFF";
				$element.style.color='#666';
				}
	}




function setStyleDisplay($elementId, $state)
	{	
	var $element = document.getElementById($elementId);
	$element.style.display=$state;
	}
	
function doConfirm(msg, url)
	{
	if(url!='')
		{
		var check = confirm(msg);
		if(check)
			{
			window.location=url;	
			}
		return false;
		}
	return false;
	}
/****** VERTIVAL MENU ******/



