window.onload=function(){
 pg_relations(); 
 fixMargins(); 
}
$(function(){
	jQuery.each(jQuery.browser, function(i) {
	  if($.browser.msie && jQuery.browser.version.substr(0,3) < "7"){
		$.ifixpng('design_img/blank.gif');
		$('#siteRightShadow, #siteLeftShadow').css("display", "block");
		$('#logotype a img, #headerTxt img, #header, #header img, .blockImg').ifixpng();
	  }
	});	  
	
	$(".thumb a").lightBox();
	/*$(".menu h6").click(function (){
		if($(this).parent().children(".menuTxt").css("display") == 'none'){
			$(this).parent().children(".menuTxt").slideDown("medium");
		}
		else{
			$(this).parent().children(".menuTxt").slideUp("medium");
		}
	});*/
	$(".menu h6 a").click(function (){
		if($(this).parent().parent().children(".menuTxt").css("display") == 'none'){
			$(this).parent().parent().children(".menuTxt").slideDown("medium");
			//return false;
			$("#menu").localScroll({hash: 'true'});
		}
		else{
			$(this).parent().parent().children(".menuTxt").slideUp("medium");
		}
		//return false;
	});
});

function pg_relations(){   
    var linkdb = document.getElementsByTagName('a');
    for(var anch=1; anch<linkdb.length; anch++){ 
        if(linkdb[anch].href.indexOf('.pdf') != -1){ 
            linkdb[anch].onclick=function() {window.open(this.href,'_blank',params); return false}; 
        }
        else if(linkdb[anch].getAttribute('rel')=='external'){ 
            linkdb[anch].onclick=function() {window.open(this.href,'_blank',''); return false};   
        }
    }
}
function fixMargins(){
	var image = document.getElementsByTagName('img');
	for(var i = 0; i < image.length; i++){
		if(image[i].getAttribute('align') == 'left'){
			//image[i].style.float = 'left';
			image[i].style.margin = '0 15px 5px 0';
		}
		if(image[i].getAttribute('align') == 'right'){
			//image[i].style.float = 'right';
			image[i].style.margin = '0 0 5px 15px';
		}
	}
}