jQuery(document).ready(function(){
	jQuery("#nav ul li").hover(
		function () {
			jQuery(this).addClass('active');
			jQuery(this).find('.dropdown').css('display','block');
		},
		function () {
			jQuery(this).removeClass('active');
			jQuery(this).find('.dropdown').css('display','none');
		}
	);
	jQuery(".dropdown ul li").hover(
		function () {
			jQuery(this).addClass('current');
		},
		function () {
			jQuery(this).removeClass('current');
		}
	);


	jQuery('a#selling-property').click(function() {
		jQuery('#moretab').slideToggle();
	});


	archivefnc('.links-category-listing ul li', 10);
	jQuery('#categories-expand').click(function(){
		archivefnc('.links-category-listing ul li', 10);
		return false;
	})

	function archivefnc(id, limit){
		var count = 1;
		var flag = true;
		jQuery(id).each(function(){
			if(!jQuery(this).is(':visible')){
				flag = false;
				return;
			}
		})

		if(flag){
			jQuery(id).each(function(i, j){
				if(i > limit - 1){
					jQuery(this).hide();
				}
			})
		}
		else{
			jQuery(id).show();
		}
	}

});

var newwindow;
function poptastic(url)
{
	newwindow=window.open(url,'name','height=600,width=800,scrollbars=yes');
	if (window.focus) {newwindow.focus(); }
}


function setCurrencyCookie(value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie="Currency =" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString()+ ";path=/;" );
window.location.reload();
}


