// JavaScript Document
function getMovie(movieName) {
	if(window[movieName]!=null)
		return window[movieName];
	else
		return document[movieName+"2"];
}
function changeToGallery(i){
	var flash = getMovie("FlashID");
	var frame = i+1 ;
	flash.GotoFrame(frame);
}
/*=================Loader Example=================
function loaderDefault(){
	var flash = getMovie("FlashID");
	flash.init6();
}
==================================================*/
/*================Loader Example2-child=================
function loaderDefault(){
	changeToGallery(window.opener.childVariable);
}
==================================================*/
//Variable for parent and chield window gallery changing.
var childVariable;
//Calling new child window and child gallery changing.
function changeChildToGallery(i){
	childVariable=i;
	var new_window;
	//try{
		new_window = window.open('../flash/viewer.html', 'window1', 'height=260,width=670');
	//}catch(e){
	//	new_window = window.open('/flash/viewer.html', 'window1', 'height=260,width=670');
	//}
	new_window.focus();
}
function changeChildToGallery2(i){
	childVariable=i;
	var new_window;
	//try{
		if(flashVersionOK()){
		new_window = window.open('../flash/viewer2.html', 'window2', 'height=527,width=670');
		}else{
		new_window = window.open('../flash/viewer3.html', 'window2', 'height=597,width=670');
		}
	//}catch(e){
	//	new_window = window.open('/flash/viewer2.html', 'window2', 'height=527,width=670');
	//}
	new_window.focus();
}
















//+=========================CHECKING FLASH VERSION===============================
function getFlashVersion(){ 
  // ie 
  try { 
    try { 
      // avoid fp6 minor version lookup issues 
      // see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/ 
      var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6'); 
      try { axo.AllowScriptAccess = 'always'; } 
      catch(e) { return '6,0,0'; } 
    } catch(e) {} 
    return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; 
  // other browsers 
  } catch(e) { 
    try { 
      if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){ 
        return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]; 
      } 
    } catch(e) {} 
  } 
  return '0,0,0'; 
} 

function flashVersionOK(){
	var version = getFlashVersion().split(',').shift(); 
	if(version < 10){ 
		return false;
	  //alert("Lower than 10");
	}else{ 
		return true;
	  //alert("10 or higher"); 
	}
}