function P7_Uberlink(cl,d){
	var i,ob,tA,h=document.location.href;
	if(document.getElementById){
	ob=(d)?document.getElementById(d):document;
	if(ob){
	tA=ob.getElementsByTagName('A');
	for(i=0;i<tA.length;i++){
	if(tA[i].href==h){
	tA[i].className=cl;
}}}}}

/*
(function($){
$.fn.activeMenu = function(options){
	var defaults = {  
		idSwitch: 'active',
		defaultSite: null,
		defaultIndex: 0
	},  
	intialize = function(id){
		var op = $.extend({},defaults,options);
		var loc = location.href;
		
		var activeCount = 0;
		$(id).find('a').each(function(){
			var href = $(this).attr('href');
			if(loc.search(href) != -1){
				$(this).attr('id', op.idSwitch);
				activeCount++;
			}
			else{
				$(this).attr('id', '');
			}
			
			if(activeCount == 0){
				if(loc.search(op.defaultSite) != -1){
					$(id).find('a').eq(0).attr('id', op.idSwitch);
				}
			}
		});
		
	}
	
	return this.each(function(){
		intialize(this);					  
	});
}
})(jQuery);
*/

function toggleDIV(radio, div) 
{	
	var value = '';
	var radios = document.getElementsByName(radio);
	
	for( i = 0; i < radios.length; i++ )
	{
		if( radios[i].checked == true)
		{
			value = radios[i].value;
		}
	}
	
	document.getElementById(div).style.display = 'none';
	
	if (value == 1)
	{
		document.getElementById(div).style.display = 'block';
	}
}

function copyAddress(type) 
{
	if (type == 'personal')
	{	
		if (document.getElementById('personal_address'))
			var address = document.getElementById('personal_address').value;
		
		if (document.getElementById('personal_zipcode'))
			var zipcode = document.getElementById('personal_zipcode').value;
		
		if (document.getElementById('personal_city'))
			var city = document.getElementById('personal_city').value;
	}
	else
	{
		if (document.getElementById('employer_address'))
			var address = document.getElementById('employer_address').value;
		
		if (document.getElementById('employer_zipcode'))
			var zipcode = document.getElementById('employer_zipcode').value;
		
		if (document.getElementById('employer_city'))
			var city = document.getElementById('employer_city').value;
	}
	
	if (document.getElementById('delivery_address'))
		document.getElementById('delivery_address').value = address;
	
	if (document.getElementById('delivery_zipcode'))
		document.getElementById('delivery_zipcode').value = zipcode;
	
	if (document.getElementById('delivery_city'))
		document.getElementById('delivery_city').value = city;	
}

var xmlHttp;

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}


function newCaptcha()
{
	var captcha = document.getElementById('captcha_div');
	
	if (captcha) 
	{
		var xmlHttp = GetXmlHttpObject();
	
		if (xmlHttp == null)
		{
			alert ("Your browser does not support AJAX!");
			return;
		} 
		
		var url = "/inc/ajax/load_captcha.php";
		
		xmlHttp.onreadystatechange = function () 
		{
			if (xmlHttp.readyState == 4 && xmlHttp.responseText != false)
			{ 				
				captcha.innerHTML = xmlHttp.responseText;
			}	
		};
		
		xmlHttp.open("GET", url, true);
		xmlHttp.send(null);	
	}
}

