$(document).ready(function(){
	$('ul.sf-menu').superfish({ 
		hoverClass:  'sfHover',							// the class applied to hovered list items 
		delay:       1000,								// one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},	// fade-in and slide-down animation 
		speed:       'fast',							// faster animation speed 
		autoArrows:  false,								// disable generation of arrow mark-up 
		dropShadows: true,								// completely disable drop shadows by setting this to false 
		pathClass:  'current'
	});
	$('#navigation ul.pageNav').superfish({ 
		hoverClass:  'sfHover',							// the class applied to hovered list items 
		delay:       1000,								// one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},	// fade-in and slide-down animation 
		speed:       'fast',							// faster animation speed 
		autoArrows:  false,								// disable generation of arrow mark-up 
		dropShadows: true,								// completely disable drop shadows by setting this to false 
		pathClass:  'current'
	});
	 
	$('img#imgNavCompany').hover(
		function() {	$(this).attr("src","/images/buttons/company_RO.gif");	}, 
		function() {	$(this).attr("src","/images/buttons/company.gif");	});
	
	$('img#imgNavSolutions').hover(
		function() {	$(this).attr("src","/images/buttons/solutions_RO.gif");	}, 
		function() {	$(this).attr("src","/images/buttons/solutions.gif");	});
	
	$('img#imgNavMarkets').hover(
		function() {	$(this).attr("src","/images/buttons/markets_RO.gif");	}, 
		function() {	$(this).attr("src","/images/buttons/markets.gif");	});
	
	$('img#imgNavRisk').hover(
		function() {	$(this).attr("src","/images/buttons/risk_RO.gif");	},
		function() {	$(this).attr("src","/images/buttons/risk.gif");	});
	
	$('img#imgNavNews').hover(
		function() {	$(this).attr("src","/images/buttons/news_RO.gif");	}, 
		function() {	$(this).attr("src","/images/buttons/news.gif");	});
	
	$('img#imgNavContact').hover(
		function() {	$(this).attr("src","/images/buttons/contact_RO.gif");	}, 
		function() {	$(this).attr("src","/images/buttons/contact.gif");	});
	
	$('img#imgNavAbout').hover(
		function() {	$(this).attr("src","/images/buttons/about_RO.gif");	}, 
		function() {	$(this).attr("src","/images/buttons/about.gif");	});
	
	$('img#imgNavFaq').hover(
		function() {	$(this).attr("src","/images/buttons/faq_RO.gif");	}, 
		function() {	$(this).attr("src","/images/buttons/faq.gif");	});
	
	
	
	function randomString() {
		var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghiklmnopqrstuvwxyz";
		var string_length = 8;
		var randomstring = '';
		for (var i=0; i<string_length; i++) {
			var rnum = Math.floor(Math.random() * chars.length);
			randomstring += chars.substring(rnum,rnum+1);
		}
		document.randform.randomfield.value = randomstring;
	}

	
	// popup windows
	$("a").click(function(){
		if ($(this).attr("target") == "_blank") {
			var strWin = randomString();
			window.open($(this).attr("href"),strWin,"top=10,left=10,width=940,height=540");
		}
	});
});
