// Copyright (c) 2009 Autohound
// Author: Bora Nikolic


var SELECTED;

function fullScreen(selectedPhoto) {
	swfobject.removeSWF("coverflow");
	SELECTED = selectedPhoto;
	window.moveTo(0, 0);
	window.resizeTo(screen.width, screen.height);
	SWFDelegate('ahound_cflow.swf',(screen.width/1.5),(screen.height/1.5),"");
	
}

function closeFullScreen() {
	document.getElementsByTagName("ZOOM").innerHTML = "";
	loadCoverFlow();
	
}


function closeButton() {

	Lightbox.prototype.closeCoverflow();
	closeFullScreen();
}

function SWFDelegate(url,width,height,caption) {

	var objLink = document.createElement('a');
	objLink.setAttribute('href',url);
	objLink.setAttribute('rel','lightbox');
	if(typeof width != 'undefined') {
		objLink.setAttribute('width',width);
	}
	if(typeof height != 'undefined') {
		objLink.setAttribute('height',height);
	}
	Lightbox.prototype.start(objLink);

	
}

function loadCoverFlow() {
	
	if (swfobject.hasFlashPlayerVersion("8.0.0")) {
	  	var c = document.getElementById("coverContent");
		if (!c) {
			var d = document.createElement("div");
			d.setAttribute("id", "coverflow");
			document.getElementById("coverContent").appendChild(d);
		}
	  var fname = '/Flash/ahound_cflow.swf?'+Math.floor(Math.random()*100)
      var fn = function() {
        var att = { data:fname, width:"615", height:"450" };
        var par = { wmode: "opaque", flashvars:"KEY="+KEY+"&DEALER="+DEALER+"&INVENT="+INVENT };
        var id = "coverContent";
        var myObject = swfobject.createSWF(att, par, id);
      };
      swfobject.addDomLoadEvent(fn);
    }
 

}
function helloworld()
{
    alert("hello!");
}
