//<script type='text/javascript'>

 $(document).ready(function(){

   $(".extendclass").parent().mouseenter(function(){
    tip_id = '#'+$(this).children('a:first').attr('id')+'_tip';
  $(tip_id).show();
  }).mouseleave(function(){
    tip_id = '#'+$(this).children('a:first').attr('id')+'_tip';
  $(tip_id).hide();
  });

  $("#frame_holder").dialog({
modal: true,
autoOpen: false,
			height: 500,
			width: 550,

			buttons: {
				Ok: function() {
					$( this ).dialog( "close" );
				}
			}

    });
 $('a.popupSched').click(function(){

 myid = $(this).attr('href').replace("#", "");
 name =$(this).attr('rel');
 lang =base_lang;
 url =  base_url + 'classes/popupSchedule.php?action=showPopup';
$.get(url, { id: myid, name: name, lang:lang},
   function(data){
    $("#frame_holder .framecontent").html(data);
   $("#frame_holder").dialog({title: name});
  $("#frame_holder").dialog('open');
   });

 });

  $('a.popupClass').click(function(){

 myid = $(this).attr('href').replace("#", "");
 name =$(this).attr('rel');
 lang =base_lang;
 url =  base_url + 'classes/popupSchedule.php?action=showPopupClass';
$.get(url, { id: myid, name: name, lang:lang},
   function(data){
    $("#frame_holder .framecontent").html(data);
   $("#frame_holder").dialog({title: name});
  $("#frame_holder").dialog('open');
   });

 });

flavourFlashObjects();
$('iframe').load(function() {
  this.style.height =
  this.contentWindow.document.body.offsetHeight + 'px';
});

 });


function flavourFlashObjects(){
  $('.flash_holder').each(function(){

    //$(this).attr('id',id);
    $(this).hide();
myid =  $(this).parent().attr('id');

   var height = $(this).attr('height');
   var width = $(this).attr('width');

 //  var myfloat = $(this).css('float');
    var myalt = $(this).attr('alt');
  myalt = myalt.split('|');
 var src = myalt[0];
 var loop = myalt[1];
 var autoplay = myalt[2];
 var type = myalt[3];

 //alert(myalt);
if(type == 'mp3'){
 // insertmp3(myid,src);
  var so = new SWFObject(base_url + 'js/player_mp3_maxi.swf',myid,'200','20','6');
     so.addParam("wmode", "transparent");
	    so.addParam("movie", "player_mp3_maxi.swf");
  so.addVariable('mp3',src);
    so.addVariable('autoplay',autoplay);
    so.addVariable('loop',loop);
	    so.addVariable('buttoncolor','ffffff');
	 		so.addVariable('loadingcolor',base_color);
	      so.addVariable('buttonovercolor',base_color);
	      so.addVariable('slidercolor1','ffffff');
	  	so.addVariable('slidercolor2','ffffff');
				so.addVariable('showinfo','0');
				so.addVariable('showstop','0');
		     so.addVariable('sliderovercolor',base_color);

  so.write(myid);
}else if(type == 'video'){

  var so = new SWFObject(base_url + 'js/mediaplayer.swf',myid,width,height,'8');
  so.addParam('allowscriptaccess','always');
  so.addParam('allowfullscreen','true');
  so.addVariable('width',width);
if(autoplay == 1){
  so.addVariable('autostart','true');
}
if(loop == 1){
  so.addVariable('repeat','true');
}

  so.addVariable('height',height);
  so.addVariable('file',src);
  so.addVariable('javascriptid','jstest' + myid);
  so.addVariable('enablejs','true');
      so.addVariable('backcolor','0x' + base_color);
	    so.addVariable('frontcolor','0xffffff');
		    so.addVariable('lightcolor','0x' + base_color);
			    so.addVariable('screencolor','0x000000');
 so.write(myid);

}else if(type == 'youtube'){
    var so = new SWFObject('http://www.youtube.com/v/'+src+'&rel=0&hl=en&fs=1&color1='+base_color+'&color2='+base_color,'youtube',width,height,'6');
     so.addParam("allowFullScreen", "true");
	    so.addParam("movie", "http://www.youtube.com/v/"+src+"&rel=0&hl=en&fs=1&color1="+base_color+"&color2="+base_color);
  so.write(myid);
}
  });
}
