/*
               if(isEditMode())
{
setTimeout(alert("sdasda"),500);
}
**/
function Pause() {
timer = setTimeout("endpause()",50); 
return false;
}

function endpause() {
return false;
}

//var $ = jQuery.noConflict();

$(document).ready(function(){



$("#MainBody img").each(function(){
//if(isEditMode()) {
//
//}
//alert("sdsdsdsd");
var classname;
if ($(this).attr('class') == null)
{
classname = "figurecenter";
$(this).addClass = ("figurecenter");
}
else
{
classname = $(this).attr('class');
}
if( $(this).width() != 0)
{
if ($(this).parent().get(0).tagName == "A")
{
$(this).parent().wrap("<div class=\"" + classname+"\" style=\"width:"+$(this).width()+"px;\""+"></div>");
}
else
{
$(this).wrap("<div class=\"" + classname+"\" style=\"width:"+$(this).width()+"px;\""+"></div>");
//alert("<div class=\"" + $(this).attr('class')+"\" style=\"width:"+$(this).width()+"px;\""+"></div>");
}

}
else
{
if ($(this).parent().get(0).tagName == "A")
{
$(this).parent().wrap("<div class=\"" + classname+"\" style=\"width:200px;\""+"></div>");
}
else
{
$(this).wrap("<div class=\"" + classname+"\" style=\"width:200px;\""+"></div>");
//alert("<div class=\"" + $(this).attr('class')+"\" style=\"width:"+$(this).width()+"px;\""+"></div>");
}
}

$(this).removeClass(classname);
//}
})});

$(document).ready(function(){
$("#MainBody img").each(function(){
if ($(this).attr('alt') != null)
{
$(this).after("<h5>" + $(this).attr('alt') +"</h5>");
}
})});


/*
$(document).ready(function(){
$("#MainBody .LeadText img").each(function(){
if ($(this).attr('class') != null)
{
if ($(this).parent().get(0).tagName == "A")
{
$(this).parent().wrap("<div class=\"" + $(this).attr('class')+"\" style=\"width:"+$(this).width()+"px;\""+"></div>");
}
else
{
$(this).wrap("<div class=\"" + $(this).attr('class')+"\" style=\"width:"+$(this).width()+"px;\""+"></div>");
//alert("<div class=\"" + $(this).attr('class')+"\" style=\"width:"+$(this).width()+"px;\""+"></div>");
}
$(this).removeClass($(this).attr('class'));
}
})});

$(document).ready(function(){
$("#MainBody .LeadText img").each(function(){
if ($(this).attr('alt') != null)
{
$(this).after("<h5>" + $(this).attr('alt') +"</h5>");
}
})});
*/

//}
//if(!isEditMode())
//{
$(document).ready(function(){
$(".RightBody img").each(function(){
if ($(this).attr('class') != null)
{
if ($(this).parent().get(0).tagName == "A")
{
$(this).parent().wrap("<div class=\"" + $(this).attr('class')+"\" style=\"width:"+$(this).width()+"px;\""+"></div>");
}
else
{
$(this).wrap("<div class=\"" + $(this).attr('class')+"\" style=\"width:"+$(this).width()+"px;\""+"></div>");
//alert("<div class=\"" + $(this).attr('class')+"\" style=\"width:"+$(this).width()+"px;\""+"></div>");
}
$(this).removeClass($(this).attr('class'));
}
})});

$(document).ready(function(){
$(".RightBody img").each(function(){
if ($(this).attr('alt') != null)
{
$(this).after("<h5>" + $(this).attr('alt') +"</h5>");
}
})});



//}