$j(document).ready(function() {
    //resize all the images
    var images=$j("img");
    for (var i=0;i<images.length;i++)
    {
        if ($j(images[i]).attr("alt")!=undefined)
        {
            var tmp=$j(images[i]).attr("alt").split("|");
            var tmp_width=$j(images[i]).css("width").replace("px","");
            var tmp_height=$j(images[i]).css("height").replace("px","");
            if (tmp[0]=="resize")
            {
                var tmp_img=$j(images[i]).attr("src");
                $j(images[i]).attr("src",HTTP_ADDRESS+"imgr/"+tmp_width+"/"+tmp_height+tmp_img);
                $j(images[i]).click(function (event) {
                    var tmp_img=$j(this).attr("src");
                    var tmp=$j(this).attr("alt").split("|");
                    var fullimgpath=HTTP_ADDRESS+"imgr/"+tmp[1]+"/"+tmp[2]+tmp_img;
                    var w_w=parseInt(tmp[1])+65;
                    var w_h=parseInt(tmp[2])+65;
                    showContentWin(tmp[3],"<img src=\""+fullimgpath+"\" />",w_w,w_h);
                });
                $j(images[i]).css("cursor","pointer");
            }
        }
    }
	 
 	$j(function(){
		$j('a[rel="external"]').attr('target','_blank');
	});
});

$j(function(){
	$j('a[rel="external"]').attr('target','_blank');
});

$j(function(){
	$j("a.flag").click(function() {
		var lang = $j(this).attr("id");
		if (lang == 'l_ro')
		{
			$j("div#lg_ro").removeClass('overheader active');
			$j("div#lg_ro").removeClass('overheader inactive');
			$j("div#lg_ro").addClass('overheader active');
			
			$j("div#lg_en").removeClass('overheader inactive');
			$j("div#lg_en").removeClass('overheader inactive');
			$j("div#lg_en").addClass('overheader inactive');
		}
		else
		{
			$j("div#lg_ro").removeClass('overheader active');
			$j("div#lg_ro").removeClass('overheader inactive');
			$j("div#lg_ro").addClass('overheader inactive');
			
			$j("div#lg_en").removeClass('overheader inactive');
			$j("div#lg_en").removeClass('overheader inactive');
			$j("div#lg_en").addClass('overheader active');
		}
		/*			
		changeActiveElement($j(this).parent().attr("id"));	
		var new_index = getCurrentIndex($j(this).parent().attr("id"));
		ChangeHeaderContent(new_index);	
		var a_el = $j("div.Element-Active");
		*/			
		//return false;
	});
});

