﻿jQuery.fn.ImageAutoSize = function(width,height)
{
    $(this).each(function()
    {
        var image = $(this);
		ywidth=image.width();
		yheight=image.height();
        if(image.width()>width)
        {
            image.width(width);
            image.height(width/ywidth*yheight);
        }
        if(yheight>height)
        {
            image.height(height);
            image.width(height/yheight*ywidth);
        }
    });
} 

jQuery.fn.ImageAutoWidthSize = function(width)
{
    $(this).each(function()
    {
        var image = $(this);
		ywidth=image.width();
		yheight=image.height();
        if(ywidth>width)
        {
            image.width(width);
            image.height(width/ywidth*yheight);
        }
    });
} 

function flash(url,width,height)
{
document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='"+width+"' height='"+height+"'><param name='movie' value='"+url+"' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><embed src='"+url+"' quality='high' wmode='transparent' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'></embed></object>");	
}


function getdata(url,id)
{
	$.ajax({
	  url: url,
	  cache: false,
	  success: function(html){
		$("#"+id).empty().append(html);
	  }
	}); 
}
