$(document).ready(function() {
	$(".dropdown img.flag").addClass("flagvisibility");
	$(".dropdown dt a").click(function() {
		$(".dropdown dd ul").toggle();
	});
	$(".dropdown dd ul li a").click(function() {
		var text = $(this).html();
		$(".dropdown dt a span").html(text);
		$(".dropdown dd ul").hide();
		var CurrenySource = $("#curreny-source");
        CurrenySource.val($(this).find("span.value").html())
		//$("#result").html("Selected value is: " + getSelectedValue("sample"));
	});
	function getSelectedValue(id) {
		return $("#" + id).find("dt a span.value").html();
	}
	$(document).bind('click', function(e) {
		var $clicked = $(e.target);
		if (! $clicked.parents().hasClass("dropdown"))
			$(".dropdown dd ul").hide();
	});
	
	$('#slider1').after('<div id="nav">').cycle({ 
			fx:     'scrollLeft', 
			timeout: 4000, 
			pager:  '#nav' 
		});
	
	
	$(".scroll").click(function(event){
        event.preventDefault();
	        //get the full url - like mysitecom/index.htm#home
	        var full_url = this.href;
	        //split the url by # and get the anchor target name - home in mysitecom/index.htm#home
	        var parts = full_url.split("#");
	        var trgt = parts[1];
	        //get the top offset of the target anchor
	        var target_offset = $("#"+trgt).offset();
	        var target_top = target_offset.top;
	        //goto that anchor by setting the body scroll top to anchor top
	        $('html, body').animate({scrollTop:target_top}, 1000);
	    });
	//$('#top-navigation').slidingMenu();
});
var slideshow=new TINY.slider.slide('slideshow',{ id:'slider', auto:3, resume:true, vertical:false, activeclass:'current', position:0 });
// www.p30vel.ir
