﻿// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// GIXVIEWER 4.0.0 Initialization Script
// © by Gix Media 2010
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// Embed Shadowbox files
function embedSBLibraries() {
	
	// Shadowbox URL
	var URL = "http://windows.gix.at/webservice/gv400/javascript/shadowbox/";
	
	// Embed CSS
	document.writeln("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + URL + "shadowbox.css\">");
	
	// Embed JavaScript Libraries
	document.writeln("<script type=\"text/javascript\" src=\"" + URL + "shadowbox.js\"></script>");
	
	// Mozilla
	if (document.addEventListener) {
		document.addEventListener("DOMContentLoaded", initShadowbox, false);
		
	// IE
	} else {
		window.onload = initShadowbox;
	}
	
}

// Initialize Shadowbox
function initShadowbox() {
	
	Shadowbox.init({
	   	language: 'en',
	   	modal: true,
	   	handleOversize: 'none',
	   	viewportPadding: 0,
	    players:  ['iframe']
	});
	
}

// Open GixViewer Shadowbox
function openGixViewer(name, width, height, imageID) {
	
	Shadowbox.open({
	    content:    "http://windows.gix.at/webservice/gv400/iframe.asp?viewerID=" + name,
	    player:     "iframe",
	   	width:      width,
        height:     height
    });
	
}

// Initialize Script
embedSBLibraries();