var lastID="";
var lastSubID="";
var standardWidth= 165;
var isAnimating=false;
var isEmptyBig=false;
var imgArr = new Array();
var idShown="";
var increasingFactor=2; 
var revreducingFactor=2; 
var clickableID="";
var adjustedHeight=120;
jQuery.noConflict();

   jQuery(window).load( function () {
   	try
   	{
   	if(document.location.href.indexOf("?")==-1) ajShow('0');
   	if(jQuery(".article_image").html().indexOf("{MOVIE}")!=-1)
   	{						   
   	jQuery(".article_image").css("color","#000");						   
   	jQuery(".article_image").append("<h3 style='color:#fff;'>Please wait while movie is loaded</h3>");						   
   	setTimeout("insertMovieinContent()",5000);	
   	}
   	}
   	catch(e)
   	{
   	}
   });
jQuery(document).ready( function () {
 							  
 jQuery('.submenuitem').corner("rounded 9px");
 jQuery('#roundedfooter').corner("rounded 9px");
 
 //jQuery(".article_image").dropShadow({left: 2, top: 2, opacity: 0.5, blur: 2});
 //jQuery(".article_description").dropShadow({left: 4, top: 4, opacity: 0.7, blur: 2,color: '#fff'});
 jQuery('a.media').media({
 	width:     350, 
    height:    250, 
    autoplay:  true, 
	showControls:false,
    flashvars: { controlbar: 'over', autostart: 'true', displayclick: 'fullscreen', scaling : 'exactfit' }, 
    caption:   false // supress caption text 
 });
  jQuery(".submenuitem").hover( function() {
 	//nothing
 },function() {
	 jQuery(".submenuitem").hide();
 });
 
 jQuery("#zoomDiv").click( function() {
									
	jQuery("#zoomDiv").fadeOut();				
	sqzNShow(clickableID);	
	
 });
 jQuery("#zoomDiv").mouseout( function() {
					
	//jQuery("#zoomDiv").fadeOut();
	
 });
  jQuery("#divMenuHolder").hover( function() {
	jQuery("#zoomDiv").fadeOut();								   
  },function() {
  });
 var options = {minWidth:150,copyClassAttr: true,hoverOpenDelay:100};      
	jQuery('#topMenu').menu(options);



});

jQuery(window).resize(function(){
 try
 {
  showSubMenu(lastSubID);
 }
 catch(e)
 {
 }
});

function setDropBackground(thisColor)
{
jQuery(".outerbox").css("background-color",thisColor);
}

function sqzNShow(id)
{
	if(!isAnimating)
	{
		
		jQuery("#zoomDiv").hide();		
		idShown = id;
		isAnimating = true;
		squeezeIn(id);
	
		if(lastID!="")
		{
		squeezeOut(lastID);
		
		}
	
		hideBig(id);
		
	}
}

function squeezeIn(id)
{ 

	if(id=="car_07")
	{		
		jQuery(".firstshow").css("overflow","hidden");
	}
	moveFirstShow(id);
	
	jQuery("#"+id).animate({
       width:0
	   },333, "linear", function(){
		 
		 lastID = id;
		});

}

function zoomin(id)
{
	//alert(id);
	if(!isAnimating)
	{
		var zLeft = (jQuery("#"+id).position().left);	
		var zTop = (jQuery("#"+id).position().top);
		jQuery("#zoomDiv").css("left",zLeft);	// + 70
		jQuery("#zoomDiv").css("top",zTop + 30); //+ 60
		
		adjustedHeight=120;
		checkForExtraTextLoadedInZoom(id);
		
		jQuery("#zoomDiv").css("width","140px");
		jQuery("#zoomDiv").css("height",adjustedHeight+"px");
		jQuery("#zoomDiv").fadeIn();
		
		clickableID = id;
	}
}
function zoomout(id)
{
    
}


function squeezeOut(id)
{
	//alert("id" + id);
	jQuery("#s_"+id).remove();
	if(id=="car_01" || id=="car_04")
	{
		
		jQuery("#"+id).animate({width:120},{queue:false,duration:333})
	}
	if(id=="car_02" || id=="car_05")
	{
		
		jQuery("#"+id).animate({width:100},{queue:false,duration:333})
	}
	if(id=="car_03" || id=="car_06")
	{
		
		jQuery("#"+id).animate({width:80},{queue:false,duration:333})
	}
		
	
}


function showBig(id)
{
	try
	{
	
	   jQuery("#showDiv").animate({
       height:250, width:350
	   },333, "swing", function(){
		 showBigPart(id);
		});

	}
	catch(e)
	{
		alert("function showBig(): "+ e);
	}
}

function showBigPart(id)
{
		if(jQuery("#m_" + id).attr("class")=="media")
		{
			//if wrongly media player or other media players are required.
         var newM = jQuery("#m_"+id).clone(true);
		 newM.attr({id: "s_"+id});
		 newM.appendTo(jQuery('#playDiv'));
		 checkForExtraText(id);
		}
		else if(jQuery("#m_" + id).attr("class")=="FLV")
		{    
		 createPlayer(jQuery("#m_" + id).attr("href"),jQuery("#m_" + id).attr("rel"));
		 //setTimeout('createPlayer(jQuery("#m_' + id + '").attr("href"),jQuery("#m_' + id + '").attr("rel"))',400);
		 checkForExtraText(id);
		}
		else if(jQuery("#m_" + id).attr("class")=="image")
		{
		  createSlideshow(id);
		  checkForExtraText(id);
		}
		else
		{
		 var newM = jQuery("#m_"+id).clone(true);
		 newM.attr({id: "s_"+id});
		 newM.appendTo(jQuery('#playDiv'));
		}
		isAnimating = false;
		isEmptyBig = false;
}
function createSlideshow(id)
{
	try
	{
	var i=0;
	var x=0;
	var x1=0;
	var x2=0;
	//first pick up the images from the anchor and place them in the showBig block
	jQuery("#showDiv").html("<div id=\"showGal\"></div>");
	jQuery("#showDiv").css("overflow","hidden");
	jQuery("#showGal").css("width","350");
	jQuery("#showGal").css("overflow","visible");
	jQuery("#showGal").html(jQuery("#m_" + id).html());
	jQuery("#showGal > img").css("margin","0");
	jQuery("#showGal > img").css("padding","0");
	jQuery("#showGal > img").css("float","left");
	//now insert click event in each image to call the actual rotator and also float them right
	//also make all other images other than first one display:none
	//finally store all available images in an array
	jQuery("#showGal > img").each(function(){
		
		if(i>0)
		{
			//jQuery(this).css("display","none");
			jQuery(this).css("width","0px");
		}
		jQuery(this).css("float","left");
		jQuery(this).css("cursor","EW-RESIZE");
		jQuery(this).mousedown(function(e) {
										
				if(!document.all)
				{
				x1 = e.pageX;
				}
				else
				{
				x1=e.clientX;
				}
				
				return false;
		});
		
		jQuery(this).mouseup(function(e) {
				
				if(!document.all)
				{					  
				x2 = e.pageX;
				}
				else
				{
				x2=e.clientX;
				}
				if((x2-x1)<0)
				{
					doSlide(jQuery(this).attr("id"));	
				}
				else if((x1-x2)<0)
				{
					doRevSlide(jQuery(this).attr("id"));	
				}
				
				return false;
				
		});
		jQuery(this).mousemove(function(e) {
				
				if(document.all)
				{					  
				
				x=e.clientX;
				jQuery(this).css("cursor","pointer");
							
				}
				return false;
						
		});
		
		jQuery(this).click(function(e) {
		
				if(document.all)
				{
				var xoffset = x-jQuery(this).position().left;
				if(0 < xoffset && xoffset < parseInt(jQuery(this).width()/2))
				{
					//alert("0<" + xoffset+"<"+(jQuery(this).width())/2);
					doSlide(jQuery(this).attr("id"));	
				}
				else if((jQuery(this).width()/2) < xoffset && xoffset < parseInt(jQuery(this).width()))
				{
					//alert((jQuery(this).width()/2) + "<" + xoffset+"<"+ (jQuery(this).width()));
					doRevSlide(jQuery(this).attr("id"));	
				}
				}
				
		});
		
		jQuery(this).dblclick(function(e) {
				
				window.location = jQuery(this).attr("alt");
				
		});
		imgArr[i] = jQuery(this).attr("id");
		i++;
	});
	}
	catch(e)
	{
		alert("function createSlideshow(): " + e);
	}
}
function doSlide(id)
{
	
	//find self position in array
	var pos=0;
	for(i=0;i<imgArr.length;i++)
	{
		if(imgArr[i]==id)
		{
			pos = i;
		}
	}
	
		//we have reached end..close this one and start from 0
		if(pos+1<i)
		{
		shrinkngrowPhoto(id,imgArr[pos+1]);
		}
		else
		{
			shrinkngrowPhoto(id,imgArr[0]);
		}
}

function doRevSlide(id)
{
	//find self position in array
	var pos=0;
	for(i=0;i<imgArr.length;i++)
	{
		if(imgArr[i]==id)
		{
			pos = i;
		}
	}
	
		//we have reached first..close this one and start from last
		if(pos<=0)
		{
		    shrinkngrowPhoto(id,imgArr[imgArr.length-1]);
		}
		else
		{
			shrinkngrowPhoto(id,imgArr[pos-1]);
		}
}

function shrinkngrowPhoto(sid,gid)
{alert("hi");
	var iTimer=0;
	if(!document.all)
	{
		iTimer = 5;
	}
	else
	{
		iTimer = 50;
	}
	jQuery("#"+gid).css("display","block");
	if(jQuery("#"+sid).width()>0)
	{
		jQuery("#"+sid).width(jQuery("#"+sid).width()-50);
		jQuery("#"+gid).width(jQuery("#"+gid).width()+50);
		setTimeout("shrinkngrowPhoto('"+sid+"','"+gid+"')",iTimer);
	}
	else
	{
		jQuery("#"+sid).css("display","none");
	}
}


function checkForExtraText(id)
{
	try
	{
	//check if spans holding data like Title, Description and Links are present with the movie
	jQuery("#m_" + id + " > span").each(function(){
		if(jQuery(this).attr("class")=="videoTitle")
		{
			var vTitle = jQuery(this).html();
			if(vTitle!="")
			{
			jQuery("#showDiv").height(jQuery("#showDiv").height()+15);
			jQuery("#showDiv").append("<span style='font-family:Trebuchet-MS,Arial,Verdana;font-weight:bold;'>"+vTitle+"</span><br\>");
			}
		}
		if(jQuery(this).attr("class")=="videoDescription")
		{
			var vDesc = jQuery(this).html();
			if(vDesc!="")
			{
			jQuery("#showDiv").height(jQuery("#showDiv").height()+45);
			jQuery("#showDiv").append("<span style='font-family:Trebuchet-MS,Arial,Verdana;font-weight:normal;text-align:left;font-size:9pt;'>"+vDesc+"</span><br\>");
			}
		}
		if(jQuery(this).attr("class")=="link")
		{
			jQuery("#showDiv").height(jQuery("#showDiv").height()+25);
			var linkSplit = new Array();
			linkSplit = jQuery(this).html().split(",");
			jQuery("#showDiv").append("<a href='"+linkSplit[1]+"' style='font-family:Trebuchet-MS,Arial,Verdana;font-weight:normal;text-align:left;font-size:9pt;text-decoration:none;color:#fff;' >"+linkSplit[0]+"</a>");
		}
		if(jQuery(this).attr("class")=="imageTitle")
		{
			var vTitle = jQuery(this).html();
			jQuery("#showDiv").height(jQuery("#showDiv").height()+25);
			jQuery("#showDiv").append("<span style='font-family:Trebuchet-MS,Arial,Verdana;font-weight:bold;'>"+vTitle+"</span><br\>");
		}
	});
	}
	catch(e)
	{
		alert("function checkForExtraText(): " + e);
	}
}

function checkForExtraTextLoadedInZoom(id)
{
	try
	{
	jQuery("#zoomDiv").empty();
	//jQuery("#zoomDiv").height(120);
	//adjustedHeight = jQuery("#zoomDiv").height();
	jQuery("#zoomDiv").append("<img src='" + jQuery("#" + id + " .reflect > img").attr("src") + "' style='width:140px;'/>");
	if(jQuery("#m_" + id).attr("title")!="")
	{
		var vTitle = jQuery("#m_" + id).attr("title");
		//jQuery("#zoomDiv").height(jQuery("#showDiv").height()+15);
		jQuery("#zoomDiv").append("<div style='font-family:Trebuchet-MS,Arial,Verdana;font-weight:bold;color:#fff;font-size:10pt;width:100%;float:left;'>"+vTitle+"</div>");
	}
	//check if spans holding data like Title, Description and Links are present with the movie
	
	jQuery("#m_" + id + " > span").each(function(){
		
		
		if(jQuery(this).attr("class")=="textSmallDescription")
		{
			var vTitle = jQuery(this).html();
			
			//jQuery("#zoomDiv").height(jQuery("#showDiv").height()+15);
			jQuery("#zoomDiv").append("<div style='font-family:Trebuchet-MS,Arial,Verdana;font-weight:bold;color:#2C97E2;font-size:9pt;width:100%;float:left;'>"+vTitle+"</div><br\>");
		}
		if(jQuery(this).attr("class")=="videoTitle")
		{
			var vTitle = jQuery(this).html();
			//jQuery("#zoomDiv").height(jQuery("#showDiv").height()+15);
			jQuery("#zoomDiv").append("<div style='font-family:Trebuchet-MS,Arial,Verdana;font-weight:bold;width:100%;float:left;'>"+vTitle+"</div>");
		}
		if(jQuery(this).attr("class")=="videoDescription")
		{
			/*var vDesc = jQuery(this).html();
			jQuery("#zoomDiv").height(jQuery("#showDiv").height()+45);
			jQuery("#zoomDiv").append("<span style='font-family:Trebuchet-MS,Arial,Verdana;font-weight:normal;text-align:left;font-size:9pt;'>"+vDesc+"</span><br\>");*/
			//do not show description in this small area
		}
		if(jQuery(this).attr("class")=="link")
		{
			//jQuery("#zoomDiv").height(jQuery("#zoomDiv").height()+25);
			adjustedHeight = 120+25;
			var linkSplit = new Array();
			linkSplit = jQuery(this).html().split(",");
			jQuery("#zoomDiv").append("<a href='"+linkSplit[1]+"' style='font-family:Trebuchet-MS,Arial,Verdana;font-weight:normal;text-align:left;font-size:9pt;text-decoration:none;color:#fff;' >"+linkSplit[0]+"</a>");
		}
		if(jQuery(this).attr("class")=="imageTitle")
		{
			var vTitle = jQuery(this).html();
			//jQuery("#zoomDiv").height(jQuery("#showDiv").height()+25);
			jQuery("#zoomDiv").append("<div style='font-family:Trebuchet-MS,Arial,Verdana;font-weight:bold;color:#fff;font-size:9pt;width:100%;float:left;'>"+vTitle+"</div><br\>");
		}
	});
	}
	catch(e)
	{
		alert("function checkForExtraTextLoadedInZoom(): " + e);
	}
}
function hideBig(id)
{
	if(!isEmptyBig)
	{
		if(jQuery("#showDiv").html()!="<div id=\"playDiv\"></div>")
		{
		swfobject.removeSWF("player1");
		jQuery("#showDiv").html("<div id=\"playDiv\"></div>");
		isEmptyBig = true;
		}
	}
	
		jQuery("#showDiv").animate({
       height:150, width:250
	   },333, "swing", function(){
		 if (jQuery.browser.msie) 
		{
			removeFlaskLeakInIE("player1");
		}
		else
		{
			swfobject.removeSWF("player1");
		}
		showBig(id);
		});
}

function pushLeftoRight(id,mul)
{
	if(id=='car_01'||id=='car_02'||id=='car_03')
	{
		//push divMenuHolder right
		jQuery(".divMenuHolder").css("padding-left","0px");
		jQuery(".divMenuHolder").css("padding-right",(140*mul)+"px");
	}
	else if(id=='car_04'||id=='car_05'||id=='car_06')
	{
		//push divMenuHolder left
		jQuery(".divMenuHolder").css("padding-right","0px");
		jQuery(".divMenuHolder").css("padding-left",(140*mul)+"px");
	}
}

function moveFirstShow(id)
{
	try
	{
	if(id=="car_01" || id=="car_02" || id=="car_03")
	{
		try
		{
		var newM = jQuery(".firstshow").clone(true);
		jQuery(".firstshow").animate({width:0},{queue:false,duration:333})
		jQuery(".firstshow").remove();
		newM.attr("class","fisheyeleft firstshow");
		newM.css("width","0px");
		newM.insertAfter("#"+id);
		
		}
		catch(e)
		{
			alert(e);
		}
		//alert(jQuery(".firstshow > div > img").attr("src"));
		if(jQuery(".firstshow > div > img").attr("src").indexOf("_2.png")==-1)
		{
		try
		{
		jQuery(".firstshow > div > img").attr("src",jQuery(".firstshow > div > img").attr("src").replace(".png","_2.png"));
		}
		catch(e)
		{
			alert("here1:"+e);
		}
		}
		if(id=="car_01")   
		{
			try
			{
			jQuery(".firstshow").attr("style","margin-top:55px;height:66px;width:0px;overflow:visible;");
			jQuery(".firstshow").animate({width:120},{queue:false,duration:333});
			jQuery(".firstshow > div > img").height("66px");
			jQuery(".firstshow > div > img").width("120px");
			jQuery(".firstshow > div > img").attr("width","120");
			jQuery(".firstshow > div > img").attr("height","66");
			if (jQuery.browser.msie)
			{
				jQuery(".firstshow > div > img").css("margin-left","0px");
				jQuery(".firstshow > div > img").css("margin-right","0px");
			}
			
			
			}
			catch(e)
			{
				alert("01");
			}
		}
		if(id=="car_02") 
		{
			try
			{
			jQuery(".firstshow").attr("style","margin-top:45px;height:76px;width:0px;overflow:visible;");
			jQuery(".firstshow").animate({width:100},{queue:false,duration:333});
			jQuery(".firstshow > div > img").height("76px");
			jQuery(".firstshow > div > img").width("100px");
			jQuery(".firstshow > div > img").attr("width","100");
			jQuery(".firstshow > div > img").attr("height","76");
			if (jQuery.browser.msie)
			{
				
				jQuery(".firstshow > div > img").css("margin-left","-20px");
				jQuery(".firstshow > div > img").css("margin-right","0px");
			}
			
			}
			catch(e)
			{
				alert("02");
			}
		}
		if(id=="car_03") 
		{
			try
			{
			jQuery(".firstshow").attr("style","margin-top:35px;height:86px;width:0px;overflow:visible;");
			
			jQuery(".firstshow").animate({width:80},{queue:false,duration:333});
			jQuery(".firstshow > div > img").height("86px");
			jQuery(".firstshow > div > img").width("80px");
			jQuery(".firstshow > div > img").attr("width","80");
			jQuery(".firstshow > div > img").attr("height","86");
			if (jQuery.browser.msie)
			{
				jQuery(".firstshow > div > img").css("margin-right","0px");
				jQuery(".firstshow > div > img").css("margin-left","-40px");
			}
			}
			catch(e)
			{
				alert("03");
			}
		}
		
		
		//if(id=="car_01")	jQuery(newM).animate({width:"120px"},{queue:false,duration:333});
//  		if(id=="car_02")	jQuery(newM).animate({width:"100px"},{queue:false,duration:333});
//		if(id=="car_03")	jQuery(newM).animate({width:"80px"},{queue:false,duration:333});
		
	}
	else if(id=="car_04" || id=="car_05" || id=="car_06")
	{
		//need to modify attributes accordingly
		//need to make class=fisheyeright
		//style="margin-top" of the one with the id + 10px;
		try
		{
		var newM = jQuery(".firstshow").clone(true);
		jQuery(".firstshow").animate({width:0},{queue:false,duration:333})
		jQuery(".firstshow").remove();
		newM.attr("class","fisheyeright firstshow");
		newM.css("width","0px");
		newM.insertAfter("#"+id);
		
		
		}
		catch(e)
		{
			alert(e);
		}
		
		//alert(jQuery("#car_07  > div > img").attr("src"));
		
		if(jQuery(".firstshow > div > img").attr("src").indexOf("_2.png")!=-1)
		{
		try
		{
		jQuery(".firstshow > div > img").attr("src",jQuery(".firstshow > div > img").attr("src").replace("_2.png",".png"));
		}
		catch(e)
		{
			alert("here:"+e);
		}
		}
		if(id=="car_04")   
		{
			try
			{
			jQuery(".firstshow").attr("style","margin-top:55px;height:66px;width:0px;overflow:visible;");
			jQuery(".firstshow").animate({width:120},{queue:false,duration:333})
			jQuery(".firstshow > div > img").height("66px");
			jQuery(".firstshow > div > img").width("120px");
			jQuery(".firstshow > div > img").attr("width","120");
			jQuery(".firstshow > div > img").attr("height","66");
			if (jQuery.browser.msie)
			{
				jQuery(".firstshow > div > img").css("margin-left","0px");
				jQuery(".firstshow > div > img").css("margin-right","0px");
			}
			}
			catch(e)
			{
				alert("04");
			}
			
		}
		if(id=="car_05") 
		{
			try
			{
			jQuery(".firstshow").attr("style","margin-top:45px;height:76px;width:0px;overflow:visible;");
			jQuery(".firstshow").animate({width:100},{queue:false,duration:333})
			jQuery(".firstshow > div > img").height("76px");
			jQuery(".firstshow > div > img").width("100px");
			jQuery(".firstshow > div > img").attr("width","100");
			jQuery(".firstshow > div > img").attr("height","76");
			if (jQuery.browser.msie)
			{
				
				jQuery(".firstshow > div > img").css("margin-left","-20px");
				jQuery(".firstshow > div > img").css("margin-right","0px");
			}
			}
			catch(e)
			{
				alert("05");
			}
		}
		if(id=="car_06") 
		{
			try
			{
			jQuery(".firstshow").attr("style","margin-top:35px;height:86px;width:0px;overflow:visible;");
			jQuery(".firstshow").animate({width:80},{queue:false,duration:333})
			jQuery(".firstshow > div > img").height("86px");
			jQuery(".firstshow > div > img").width("80px");
			jQuery(".firstshow > div > img").attr("width","80");
			jQuery(".firstshow > div > img").attr("height","86");
			if (jQuery.browser.msie)
			{
				jQuery(".firstshow > div > img").css("margin-right","0px");
				jQuery(".firstshow > div > img").css("margin-left","-40px");
			}
			}
			catch(e)
			{
				alert("06");
			}
		}
		
		
		
		//if(id=="car_04")	jQuery(newM).animate({width:"120px"},{queue:false,duration:333});
//		if(id=="car_05")	jQuery(newM).animate({width:"100px"},{queue:false,duration:333});
//		if(id=="car_06")	jQuery(newM).animate({width:"80px"},{queue:false,duration:333});
		
		
		
		
		
	}
	setTimeout('jQuery(".firstshow").reflect({height:1,opacity:0.5})',1000);
	}
	catch(e)
	{
		//alert("function moveFirstShow(): " + e.message);
	}
}

function showSubMenu(id)
{
	jQuery("#sub_"+lastSubID).hide();
	jQuery("#sub_"+id).css("left",jQuery("#m"+id).position().left);
	jQuery("#sub_"+id).css("top",jQuery("#m"+id).position().top-195);
	jQuery("#sub_"+id).show();
	lastSubID = id;
}

function showSubMenuFooter(id,did)
{
	jQuery("#sub_"+lastSubID).hide();
	
	//jQuery("#sub_"+id).css("top",jQuery("#"+did).position().top-5);
	/*MA*/
		var lft = jQuery("#"+did).width();
		//alert(lft);
		/*--------------------------*/
	try
	{
		
		jQuery("#sub_"+id).css("left",jQuery("#"+did).position().left);
		//jQuery("#sub_"+id).css("left",jQuery("#"+did).position().left+lft);
		jQuery("#sub_"+id).css("top",jQuery("#m"+id).position().top-165);//127
		
	}
	catch(e)
	{
		jQuery("#sub_"+id).css("left",jQuery("#"+did).position().left);
		//jQuery("#sub_"+id).css("left",jQuery("#"+did).position().left-lft);
		jQuery("#sub_"+id).css("top",jQuery("#roundedfooter").position().top-260);
	}
	jQuery("#sub_"+id).show();
	lastSubID = id;
}
function removeFlaskLeakInIE(id) {
	try
	{
	 var obj = jQuery("#"+id);
	
       if (obj) {
            for (var i in obj) {
				if (typeof obj[i] == "function") 
				{
                obj[i] = null;
                }
        }
        obj.parentNode.removeChild(obj);
    }
   }
   catch(e)
   {
	   
   }
}
function createPlayer(theFile,theLink, placehoder) {

var flashvars = {
file: theFile,
controlbar: 'none', 
autostart: 'true', 
displayclick: 'link', 
link: theLink,
linktarget: '_top',
scaling : 'exactfit',
duration : '30',
start : '8',
image: 'sports_images/video_poster.png'
};
var params = {
allowfullscreen:"true",
allowscriptaccess:"always",
wmode:'transparent'
};
var attributes = {
id:'player1',
name:'player1'
};

swfobject.embedSWF("mediaplayer.swf", placehoder, "350", "250", "9.0.115", false, flashvars, params, attributes);

}

function insertMovieinContent()
{
	try
	{
		
	if(jQuery(".article_image").html().indexOf("{MOVIE}")!=-1)
	{
		var movName = jQuery(".article_image").html().substring(jQuery(".article_image").html().indexOf("{file="));
		movName = movName.substring(1,movName.indexOf("}"));
		movName = movName.substring(5);
		jQuery(".article_image > h3").html("video is loaded now.Please click on the video to start");
		jQuery(".article_image").css("color","#000");
		//jQuery(".article_image").css("margin-top","-25px");
		/*jQuery(".article_image").append("<div id=\"playDivBig\">" +
										"<object id=\"player1\" height=\"350\" width=\"480\" type=\"application/x-shockwave-flash\" name=\"player1\"" + 	
										" data=\"mediaplayer.swf\">" +
 										"<param name=\"allowfullscreen\" value=\"true\"/>" +
 										"<param name=\"allowscriptaccess\" value=\"always\"/>" +
										"<param name=\"wmode\" value=\"transparent\"/>" +
										"<param name=\"flashvars\"" +
										"value=\"file=video/"+ movName +"&controlbar=over&autostart=true&displayclick=fullscreen\"/></object>" +
										"</div>");*/
		jQuery(".article_image").append("<div id=\"playDivBig\"></div>");
		createFullPlayer("images/stories/ais_video/"+ movName);
	}
	
	}
	catch(e)
	{
		//alert(e);
	}
}
//MANI:CREATE PLAYER FUNCTION FOR INNER PAGES...
function createFullPlayer(theFile) {
var flashvars2 = {
file: theFile,
controlbar: 'over', 
autostart: 'false', 
displayclick: 'fullscreen', 
scaling : 'exactfit',
image: 'sports_images/video_poster.png',
width: '480',
height: '350'
};
var params2 = {
allowfullscreen:"true",
allowscriptaccess:"never",
wmode:'transparent'
};
var attributes2 = {
id:'player1',
name:'player1'
};

swfobject.embedSWF("mediaplayer.swf", "playDivBig", "480", "350", "9.0.115", false, flashvars2, params2, attributes2);
}

function ajShow(id)
{

jQuery("#zoomDiv").hide();
jQuery("#animaxHolder").empty();
jQuery("#animaxHolder").append(jQuery("#loaderAnim").html());
jQuery.ajax({

  url: dataPath+"data_flat.php?id="+id,
  cache: false,
  success: function(html){
	
	lastID="";
	jQuery("#animaxHolder").empty();  
	
	jQuery("#animaxHolder").append(html);
	/*jQuery(".reflect").reflect({height:1,opacity:0.25});
	jQuery("#showDiv").height("80px");
	setTimeout('sqzNShow(jQuery(".firstshow").attr("id"))',100);
	sqzNShow(jQuery(".firstshow").attr("id"));*/
    jQuery("#animaxHolder").caroussel({start:3});
  }
});
}

function ajShowPage(id,sid)
{
	
jQuery("#zoomDiv").hide();
jQuery("#animaxHolder").empty();
jQuery("#animaxHolder").append(jQuery("#loaderAnim").html());

jQuery.ajax({
  url: dataPath+"data_flat.php?id="+id + "&sub_id="+sid,
  cache: false,
  success: function(html){
	lastID="";
	jQuery("#animaxHolder").empty();  
    jQuery("#animaxHolder").append(html);
	jQuery(".reflect").reflect({height:1,opacity:0.25});
	jQuery("#showDiv").height("80px");
	//setTimeout('sqzNShow(jQuery(".firstshow").attr("id"))',100);
	sqzNShow(jQuery(".firstshow").attr("id"))
  }
});
}

function ajShowPagenSqueez(id,sid,cid)
{
jQuery("#zoomDiv").hide();
jQuery("#animaxHolder").empty();
jQuery("#animaxHolder").append(jQuery("#loaderAnim").html());

jQuery.ajax({
  url: dataPath+"data_flat.php?id="+id + "&sub_id="+sid,
  cache: false,
  success: function(html){
	lastID="";
	jQuery("#animaxHolder").empty();  
    jQuery("#animaxHolder").append(html);
	jQuery(".reflect").reflect({height:1,opacity:0.25});
	jQuery("#showDiv").height("80px");
	if (jQuery.browser.msie) 
	{
	setTimeout('sqzNShow("car_0' + cid + '")',100);
	}
	else
	{
	sqzNShow("car_0" + cid);
	}
  }
});
}

function goToMenunSqueez(mid,sid)
{
jQuery("#zoomDiv").hide();	
jQuery("#animaxHolder").empty();
jQuery("#animaxHolder").append(jQuery("#loaderAnim").html());
//alert(dataPath+"data_flat.php?id="+mid+"&sid="+sid);
jQuery.ajax({
  url: dataPath+"data_flat.php?id="+mid+"&sid="+sid,
  
  cache: false,
  success: function(html){
	lastID="";
	jQuery("#animaxHolder").empty();  
    jQuery("#animaxHolder").append(html);
	/*jQuery(".reflect").reflect({height:1,opacity:0.25});
	jQuery("#showDiv").height("80px");
	if (jQuery.browser.msie) 
	{
	setTimeout('sqzNShow("car_0' + sid + '")',100);
	}
	else
	{
	sqzNShow("car_0" + sid);
	}*/
    jQuery("#animaxHolder").caroussel({start:3});
  }
});
}


/***********************************************
* Bookmark site script- � Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
	
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}
