// Normal Validation

function searchformSubmit(elementname){
	
	var searchtextnew	=	document.getElementById(elementname).value;
	if(searchtextnew == '' || searchtextnew == 'Search FAQ')
	{
		alert("Search string should not be empty");
		return false;
	}
	var formurl =	'http://'+document.domain+'/frequently-asked-questions-answers/searchString/'+searchtextnew;
	window.location.href = formurl;
	return false;	
}


function searchSubmit(){

	
	var searchtextnew	=	document.getElementById('searchstring').value;
	
	if(searchtextnew == '' || searchtextnew == 'By Keyword')
	{
		alert("Search string should not be empty");
		document.getElementById('searchstring').focus();
		return false;
	}
	//var formurl =	'http://'+document.domain+'/bookshop/searchString/'+searchtextnew;
	//window.location.href = formurl;
	return true;	
}

function unckeckValue(comp, val) {

if(comp.checked == false){
	$(comp).attr('checked','');
}
else
{
$('.'+val+':checkbox').attr('checked', $( comp ).is( ':checked' ) ? '' : '' );
$(comp).attr('checked','checked');
}
}

// Normal Validation

jQuery(document).ready(function(){
	jQuery('#checkoutSess a').click(function(){
		jQuery('#sessFrm').submit();
		return false;
	});
});

jQuery(document).ready(function(){
	jQuery('#myjquerymenu a').click(function(){
		var t= jQuery(this).attr('href');
		var r = 'http://www.ames.net.au';
		if(location.hostname == 'secure.ames.net.au' && t!='/settlement-extranet-login'){
			jQuery('#sessTransFrm').attr('action',r+t).submit();
			return false;
		}
	});
});
jQuery(document).ready(function(){
	jQuery('#myjquerymenu_i a').click(function(){
		var currLink = jQuery(this).attr('href');
		var currUrl = 'https://secure.ames.net.au';
		if(location.hostname == 'www.ames.net.au' || location.hostname == 'ames.net.au'){
			jQuery('#sessTransFrm').attr('action',currUrl+currLink).submit();
			return false;
		}
		
	});
});

jQuery(document).ready(function(){
	jQuery('#sitemap a').click(function(){
		var currLink = jQuery(this).attr('href');

		var currUrl = 'http://www.ames.net.au';
		if(location.hostname == 'secure.ames.net.au' && currLink!='/settlement-extranet-login'){
			jQuery('#sessTransFrm').attr('action',currUrl+currLink).submit();
			return false;
		}
		
	});
});
jQuery(document).ready(function(){
	jQuery('#legals a').click(function(){
var t= jQuery(this).attr('href').replace('https://secure.ames.net.au','http://www.ames.net.au');
	if(location.hostname == 'secure.ames.net.au'){
			jQuery('#sessTransFrm').attr('action',t).submit();
			return false;
		}
	});
});
jQuery(document).ready(function(){
	jQuery('#header_01 a').click(function(){
var t= jQuery(this).attr('href').replace('https://secure.ames.net.au','http://www.ames.net.au');
	if(location.hostname == 'secure.ames.net.au'){
			jQuery('#sessTransFrm').attr('action',t).submit();
			return false;
		}
	});
});

jQuery(document).ready(function(){
	jQuery('#myjquerymenu a').click(function(){
	var currLink= jQuery(this).attr('href');
    if(currLink== '/settlement-extranet-login'){

		if(location.hostname=='www.ames.net.au'){
			var currUrl='https://secure.ames.net.au';
       		jQuery('#sessTransFrm').attr('action',currUrl+currLink).submit();
			return false;
		}
	}
});
});

jQuery(document).ready(function(){
	jQuery('#sitemap a').click(function(){
	var currLink= jQuery(this).attr('href');
    if(currLink== '/settlement-extranet-login'){

		if(location.hostname=='www.ames.net.au'){
			var currUrl='https://secure.ames.net.au';
       		jQuery('#sessTransFrm').attr('action',currUrl+currLink).submit();
			return false;
		}
	}
});
});

jQuery(document).ready(function(){
	jQuery('#sitemap a').click(function(){
	var currLink= jQuery(this).attr('href');
    if(currLink== '/settlement-extranet-login'){

		if(location.hostname=='www.ames.net.au'){
			var currUrl='https://secure.ames.net.au';
       		jQuery('#sessTransFrm').attr('action',currUrl+currLink).submit();
			return false;
		}
	}
});
});
jQuery(document).ready(function(){
	jQuery('#home_cont_wrap a').click(function(){
	var currLink= jQuery(this).attr('href');
	if(currLink =='https://secure.ames.net.au/login')
	{
		jQuery('#sessTransFrm').attr('action',currLink).submit();
		return false;
	}
	});							
});
