// ----------------------------------------------

$(document).ready(function() {

	$(".slideshow").cycle();

});



/**
*	Set events
**/

// ----------------------------------------------

/**
*	$$
*
*	Returns an object reference
*	for the given object id
**/
function $$(obj_id)
{
	return document.getElementById(obj_id);
}

// ----------------------------------------------

/**
*	Add in_array function to array
**/
Array.prototype.hasValue = function(value) 
{
	var len = this.length;
	for (var x = 0; x <= len; x++) 
	{
		if (this[x] == value) 
		{
			return true;
		}
	}
	return false;
}

// ----------------------------------------------

function GetWindowSize(dim) 
{
	var x,y;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	
	return (dim == 'width' ? x : y);
}

// ----------------------------------------------

/**
*	GetSelVal
*
*	Returns the value of the selected option
*	of the given select (object id).
**/
function GetSelVal(sel_id)
{
	if ($$(sel_id).selectedIndex != null)		// index could be 0
	{
		return $$(sel_id).options[$$(sel_id).selectedIndex].value;
	}
	return '';
}

// ----------------------------------------------

function Display(element)
{
	element.style.display = '';
}

/*
	popup
*/
function customPopup(URL, width, height){
	newWindow = window.open(URL, 'popup', 'toolbar=no,location=no, left=40, scrollbars=yes,width= '+ width + ',height='+ height +'')
}

function Hide(element)
{
	element.style.display = 'none';
}

function showReadMoreText()
{
	var readlink = $$('readlink');
	var extra = $$('extra');
	var closelink = $$('closelink');

	Hide(extra);

	readlink.onclick = function() { Display(extra); }
	
	closelink.onclick = function() { Hide(extra); }
	
}



function initialize()
{

	if ($$('readlink') && $$('extra') && $$('closelink'))
	{
		showReadMoreText();
	}
}


window.onload = initialize;



