// JavaScript Document
function loadJSLibraries(libraryName){
	$('body').append('<script type="text/javascript" src="/js/library/'+libraryName+'.js"><\/script>');
}

//jQuery.noConflict();

$(function(){	
	//infiedl label
	$(".search label").inFieldLabels({fadeOpacity:.2});
	
	//mouse ove nav-bar
	$("ul#listmenu > li").hover(function(){
		$(this).find("ul").fadeIn(); // show
	}, function(){
		var hide = $(this).hasClass("show");
		!hide ? $(this).find("ul").fadeOut() : ''; // hide
		$("ul#listmenu > li.show ul").show();
	})
	
	//window pop-up
	$('a.popup').click(function(){
		var w = 410 , h = 440;
		var size = $(this).attr("rel");
		if(size != ''){
			var str = size;
			var pattern = /x/i;
			result = str.split(pattern);
			w = result[0];
			h = result[1];
		}
 		window.open(this.href, '', 'width='+w+', height='+h+', scrollbars=yes, toolbar=no, location=no, status=no, menubar=no, resizable=no');
 		return false;
	});
	
	//fade out box
	//$('.fadeBox').fadeOut(6000); removed as users are unable to see it
});


//for ipad/ipod/iphone/android
$('#listmenu a').live('touchend', function(e) {
    var el = $(this);
    var link = el.attr('href');
    window.location = link;
});

//OMMITURE
function linkCode(obj,filename) {
	var s=s_gi('mshankencigar');
	s.linkTrackVars='None';
	s.linkTrackEvents='None';
	s.tl(obj,'d',filename);
}
