 function showiframebycatid(catid){
	
	$("#iframe").attr('src','http://techmaster.ru/index.php?option=com_page&view=ajax&Itemid=5&zoo_category=' + catid);
	
	$("#iframe").bind('load',function(){
	
		$("#iframediv").style.display = 'block';
	});
 return false;
 
 }
 
  function showiframebyurl(url){

	$("#iframe").attr('src',url);
	//dump($("#iframe"));
	var obj = new Object;
	if(jQuery.browser.msie){
	obj.width='700';
	obj.height='500';
	}else{
	obj.width='700px';
	obj.height='500px';
	
	}

	$("#iframediv").dialog(obj);

  return false;
 }
 $(document).ready(function () {

  $("a[title='ajax']").bind("click",function(){showiframebyurl(this.href); return false;});

 });

 function dump(obj){
 var str='';
 for( var i in obj){
 
 str+= i + " = " + obj[i] +"\r\n";
 
 }
 alert(str);
 }
 
 
 function playmovie(movieName){
 
	var movie = thisMovie(movieName);
	
  if (movieIsLoaded(movie)) {
  

    movie.Play();
  }

 }
 
 
  function stopmovie(movieName){
 
	var movie = thisMovie(movieName);
	
  if (movieIsLoaded(movie)) {
  

    movie.StopPlay();
	 movie.Rewind();
  }

 }
 

  function stopmovies(e){
	if(!e.success)return;

	var movie = e.ref;
//alert(movie);
	if(!e.ref)return;
	if(!movie)return;
 // if (movieIsLoaded(movie)) {
  
try{
   movie.StopPlay();
    movie.Rewind();
 // }
}catch(e){


}
 }
 
 
 function thisMovie(movieName) {


  if (window.document[movieName]) 
  {
    return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }

}
 
 function movieIsLoaded (theMovie) {
  // First make sure the movie's defined.

  if (typeof(theMovie) != "undefined") {
    // If it is, check how much of it is loaded.
    return theMovie.PercentLoaded() == 100;
  } else {
    // If the movie isn't defined, it's not loaded.
    return false;
  }
}

