// *******************************************************************************************
//	mouseover
// *******************************************************************************************

function MouseOver(el,farleft)
{ 
	var left = el.previousSibling;
	var right = el.nextSibling;	

	el.style.backgroundImage='url("/shared/images/custom/1024/header_top_button_bg_selected.gif")';
	right.style.backgroundImage='url("/shared/images/custom/1024/header_top_button_right_selected.gif")';
	
	if(farleft == "farleft") {
		left.style.backgroundImage='url("/shared/images/custom/1024/header_top_button_farleft_selected.gif")';
	}
	else {
		left.style.backgroundImage='url("/shared/images/custom/1024/header_top_button_left_selected.gif")';
	}	
}

function MouseOut(el,farleft)
{	
	if(el.className.indexOf("selected_") != 0) /* no mouseout when button is selected*/
	{
		var left = el.previousSibling;
		var right = el.nextSibling;	
		
		el.style.backgroundImage='url("/shared/images/custom/1024/header_top_button_bg.gif")';
		right.style.backgroundImage='url("/shared/images/custom/1024/header_top_button_right.gif")';
    	
		if(farleft == "farleft") {
			left.style.backgroundImage='url("/shared/images/custom/1024/header_top_button_farleft.gif")';
		}
		else {
			left.style.backgroundImage='url("/shared/images/custom/1024/header_top_button_left.gif")';
		}
	}
}

function MouseOver_bot(el,farleft)
{ 
	var left = el.previousSibling;
	var right = el.nextSibling;	
	
	el.style.color='#FFFFFF';

	if(farleft == "farleft") {
		el.style.backgroundImage='url("/shared/images/custom/1024/header_bot_button_farleft_bg_selected.gif")'; /*deze moet nog aangepast worden*/
		right.style.backgroundImage='url("/shared/images/custom/1024/header_bot_button_farleft_right_selected.gif")';
		left.style.backgroundImage='url("/shared/images/custom/1024/header_bot_button_farleft_selected.gif")';
	}
	else {
		el.style.backgroundImage='url("/shared/images/custom/1024/header_bot_button_bg_selected.gif")';
		right.style.backgroundImage='url("/shared/images/custom/1024/header_bot_button_right_selected.gif")';
		left.style.backgroundImage='url("/shared/images/custom/1024/header_bot_button_left_selected.gif")';
	}	
}

function MouseOut_bot(el,farleft)
{	
	if(el.className.indexOf("selected_") != 0) /* no mouseout when button is selected*/
	{
		var left = el.previousSibling;
		var right = el.nextSibling;	
		
		el.style.color='#E3E1E0';
		
		if(farleft == "farleft") {
			el.style.backgroundImage='url("/shared/images/custom/1024/header_bot_button_farleft_bg.gif")';
			right.style.backgroundImage='url("/shared/images/custom/1024/header_bot_button_right.gif")';
			left.style.backgroundImage='url("/shared/images/custom/1024/header_bot_button_farleft.gif")';
		}
		else {
			el.style.backgroundImage='url("/shared/images/custom/1024/header_bot_button_bg.gif")';
			right.style.backgroundImage='url("/shared/images/custom/1024/header_bot_button_right.gif")';
			left.style.backgroundImage='url("/shared/images/custom/1024/header_bot_button_left.gif")';
		}
	}		
}

function ContentMouseOver(el)
{
	el.style.backgroundColor='#F3F7FC';
}

function ContentMouseOut(el)
{
	el.style.backgroundColor='white';
}

/* favorits */

function CallUrl(url)
{
	var tag = document.createElement("script");
	tag.type="text/javascript";
	tag.src = url;
	document.getElementsByTagName("head")[0].appendChild(tag);
	window.status='';
  
	return true;
}

/* order directly */

function DoHttpRequest(url, callback_function, el)
{
    var http_request = false;

    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            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('Unfortunatelly you browser doesn\'t support this feature.');
        return false;
    }

    http_request.onreadystatechange = function() {
	
        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
                //eval(callback_function + "(http_request.responseXML, " + id + ")");
				eval(callback_function + "(http_request.responseXML, el)");
            } else {
                alert('There was a problem with the request.(Code: ' + http_request.status + ')');
            }
        }
    }
    http_request.open('GET', url, true);
    http_request.send(null);
}

function DirectOrder(xml, el)
{
	var xmlDoc = xml;
	
	var sp_id = xmlDoc.getElementsByTagName('sp_id');

	var spl_title = xmlDoc.getElementsByTagName('spl_title');
		
	if(spl_title[0].firstChild)
	{
	 	//el.style.color="green";
		//el.style.fontWeight="bold";
		
		var text = "<img src='/shared/images/custom/1024/icon_yes.gif' border='0' width='23' height='24' style='vertical-align:-50%;'> " + spl_title[0].firstChild.nodeValue;
		//var sp_id = sp_id[0].firstChild.nodeValue;	
	}
	else
	{
		el.style.color="red";
		el.style.fontWeight="bold";
		el.nextSibling.nextSibling.style.fontWeight="bold";
		var text = "<img src='/shared/images/custom/1024/icon_no.gif' border='0' width='24' height='24' style='vertical-align:-50%;'> Dit is geen geldig artikel nummer";	
	}
	el.nextSibling.nextSibling.innerHTML=text;	
	
}

function CreatePopupWindow(loc,width,height) {
	window.open(loc,'_new','width='+width+',height='+height+',status=no,scrollbars=yes,toolbar=no,location=no,menubar=no,directories=no,resizable=yes');
	return;
}

