// JavaScript Document	
hs.graphicsDir = '/ferrousmp/js/graphics/';
/*hs.outlineType = 'rounded-white';*/
hs.wrapperClassName = 'draggable-header no-footer';
hs.allowSizeReduction = false;
// always use this with flash, else the movie will be stopped on close:
hs.preserveContent = false;
hs.showCredits = false;

hs.dimmingOpacity = 0.5;
hs.onDimmerClick = function() { return false; }


hs.creditsPosition = 'bottom left';
/*hs.outlineType = 'custom';*/
hs.fadeInOut = true;
hs.align = 'center';
hs.useBox = true;
hs.width = 600;
hs.height = 400;
hs.captionEval = 'this.a.title';
hs.registerOverlay({
	html: '<div class="closebutton" onclick="return hs.close(this)" title="Close"></div>',
	position: 'top right',
	useOnHtml: true,
	fade: 2 // fading the semi-transparent overlay looks bad in IE
});


// Add the slideshow controller
hs.addSlideshow({
	slideshowGroup: 'group1',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		className: 'large-dark',
		opacity: '0.6',
		position: 'bottom center',
		offsetX: '0',
		offsetY: '-15',
		hideOnMouseOut: true
	},
	thumbstrip: {
		mode: 'horizontal',
		position: 'below',
		relativeTo: 'image'
	}

});

// gallery config object
var config1 = {
	slideshowGroup: 'group1',
	thumbnailId: 'thumb1',
	numberPosition: null,
	transitions: ['expand', 'crossfade'],
	width:840,
	height:480
};

// Add the slideshow controller
hs.addSlideshow({
	slideshowGroup: 'group2',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		className: 'large-dark',
		opacity: '0.6',
		position: 'bottom center',
		offsetX: '0',
		offsetY: '-15',
		hideOnMouseOut: true
	},
	thumbstrip: {
		mode: 'horizontal',
		position: 'below',
		relativeTo: 'image'
	}

});

// gallery config object
var config2 = {
	slideshowGroup: 'group2',
	thumbnailId: 'thumb2',
	numberPosition: null,
	transitions: ['expand', 'crossfade'],
	width:461,
	height:700
};

// Add the slideshow controller
hs.addSlideshow({
	slideshowGroup: 'group3',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		className: 'large-dark',
		opacity: '0.6',
		position: 'bottom center',
		offsetX: '0',
		offsetY: '-15',
		hideOnMouseOut: true
	},
	thumbstrip: {
		mode: 'horizontal',
		position: 'below',
		relativeTo: 'image'
	}

});

// gallery config object
var config3 = {
	slideshowGroup: 'group3',
	thumbnailId: 'thumb3',
	numberPosition: null,
	transitions: ['expand', 'crossfade'],
	width:840,
	height:480
};


// Add the slideshow controller
hs.addSlideshow({
	slideshowGroup: 'group4',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		className: 'large-dark',
		opacity: '0.6',
		position: 'bottom center',
		offsetX: '0',
		offsetY: '-15',
		hideOnMouseOut: true
	},
	thumbstrip: {
		mode: 'horizontal',
		position: 'below',
		relativeTo: 'image'
	}

});

// gallery config object
var config4 = {
	slideshowGroup: 'group4',
	thumbnailId: 'thumb4',
	numberPosition: null,
	transitions: ['expand', 'crossfade'],
	width:840,
	height:480
};


// Add the slideshow controller
hs.addSlideshow({
	slideshowGroup: 'group5',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		className: 'large-dark',
		opacity: '0.6',
		position: 'bottom center',
		offsetX: '0',
		offsetY: '-15',
		hideOnMouseOut: true
	},
	thumbstrip: {
		mode: 'horizontal',
		position: 'below',
		relativeTo: 'image'
	}

});

// gallery config object
var config5 = {
	slideshowGroup: 'group5',
	thumbnailId: 'thumb5',
	numberPosition: null,
	transitions: ['expand', 'crossfade'],
	width:791,
	height:440
};
/***** END HIGHSLIDE CONFIG **********/




   function hidediv(thediv) {
		$('#'+thediv).fadeOut(300);		
	}
	function showdiv(thediv) {
		$('#'+thediv).fadeIn(600);
	} 
	
	
	function loadPage(data)
	{
		setTimeout("setLocation('"+data+"')",100);
		/*xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  }
		var url = "stubs/"+T67489+"/"+data+".php";
		
		xmlHttp.open("POST", url, true);
		params = 'name='+data+"&edit=true";
		//Send the proper header information along with the request
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		
		xmlHttp.onreadystatechange = function() {//Call a function when the state changes. redirect
			if(xmlHttp.readyState == 4) {
				document.getElementById('content').innerHTML = xmlHttp.responseText;
			}
		}
		xmlHttp.send(params);	
		*/
	}	
	
	function setLocation(data){
		window.location = pageName()+"?s="+data;
	}
	
	
	
function GetXmlHttpObject(){
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;}  


function getBaseURL() {
    var url = location.href;  // entire url including querystring - also: window.location.href;
    var baseURL = url.substring(0, url.indexOf('/', 14));


    if (baseURL.indexOf('http://localhost') != -1) {
        // Base Url for localhost
        var url = location.href;  // window.location.href;
        var pathname = location.pathname;  // window.location.pathname;
        var index1 = url.indexOf(pathname);
        var index2 = url.indexOf("/", index1 + 1);
        var baseLocalUrl = url.substr(0, index2);

        return baseLocalUrl + "/";
    }
    else {
        // Root Url for domain name
        return baseURL + "/";
    }

}

function pageName(){
	//var url = document.URL;
	var url = window.location.href
	var base = url.substring(0, url.lastIndexOf("?"));
	return base;
}
