var setHeight;
$(function(){
	//for safari and chrome
	//alert($.browser.msie);
	if($.browser.msie){
		
		$(".copyMainImage").next().addClass("firstPara");
		if($("#theCopy").height()){var firstParaPadding = $("img.mainTitleImg").height()-51;}
		else if($("#theCopy2").height()){var firstParaPadding = $("img.mainTitleImg").height()+20;}
		var thePadding = String(firstParaPadding)+"px";
		$(".firstPara").css('padding-top',thePadding);
		//alert(thePadding);
														 
	}else{
		
		if (jQuery.browser.safari && document.readyState != "complete"){
			setTimeout( arguments.callee, 100 );
			return;
		}
		
		$(".copyMainImage").next().addClass("firstPara");
		
		//adds the padding needed for the different heights
		var firstParaPadding = $("img.mainTitleImg").height()-51;
		var thePadding = String(firstParaPadding)+"px";
		$(".firstPara").css('padding-top',thePadding);
		
		if($("#theCopy").height()){
			setHeight = setInterval ( "doHeight()", 100 );
			//alert('if');
		}
		else if($("#theCopy2").height()){
			setHeight = setInterval ( "doHeight2()", 100 );
			//alert('else if');
		}
		else{setHeight = setInterval ( "doHeight()", 100 );
			//alert('else');
		}
	}
});
function doHeight(){
	if($("img.mainTitleImg").height() != 0){
		var firstParaPadding = $("img.mainTitleImg").height() - 51;
		var thePadding = String(firstParaPadding)+"px";
		$(".firstPara").css('padding-top',thePadding);
		//console.log("testYes");
		clearInterval(setHeight);
	}
	else{
		//console.log("testNo");
	}
}
function doHeight2(){
	if($("img.mainTitleImg").height() != 0){
		var firstParaPadding = $("img.mainTitleImg").height() + 20;
		var thePadding = String(firstParaPadding)+"px";
		$(".firstPara").css('padding-top',thePadding);
		//console.log("testYes");
		clearInterval(setHeight);
	}
	else{
		//console.log("testNo");
	}
}