// IFrame Control. Created by Turkline 2009 - Creator Þevket Bulamaz

$(document).ready(function(){
	function iResize()
	{
		$('.internalFrame').each(function(index){
		$(this).attr("scrolling","no");
		$(this).height($(this).contents().find("body").height());
		ScrollDuzenle();
		});
	}

	if ($.browser.safari || $.browser.opera){

		$('.internalFrame').load(function(){
			setTimeout(iResize, 0);
		});
	
		$('.internalFrame').each(function(){
			var iSource = $(this).attr('src');
			$(this).attr('src') = '';
			$(this).attr('src') = iSource;
		});
	}else{
		$('.internalFrame').load(function(){
			$(this).attr("scrolling","no");
			var XXL = $(this).contents().find("body").height();
			$(this).height(XXL-1);
			ScrollDuzenle();
		});
	}
	
	function ScrollDuzenle(){
	if($.browser.firefox){
		
	}else{
		if(disableS==0){
			$('.track').each(function(){
				$(this).parent('div').css("overflow","auto");
				$(this).remove();
			});
			$('.scroll').css({top : 0, left : 0});
			disableS = 1;
			}
			$('.scroll').each(function(){
				var sergeant = $(this).attr('id');
				var parent = $(this).parent('div').attr('id');
				ScrollLoad (parent, sergeant, true);
			});
			disableS = 0;
		}
	}
}); 

