<!--
function openImageView(image) {
	var imgURL = image.href;
	image.href = "javascript:void window.open('imageView.asp?image="+imgURL+"','imageView','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=600,top=0,left=0');";
	image.onclick = "";
}

function openPopUp(element) {
	var elementURL = element.href;
	element.href = "javascript: document.getElementById('inlinePopUp').style.display=''; ajaxRequest('"+elementURL+"','inlinePopUpAjax');"
	element.onclick = "";
}

function expTxt(id){
document.getElementById(id+"menu").style.display="";
document.getElementById(id+"linkOpen").style.display="";
document.getElementById(id+"linkClose").style.display="none";
}

function colTxt(id){
document.getElementById(id+"menu").style.display="none";
document.getElementById(id+"linkOpen").style.display="none";
document.getElementById(id+"linkClose").style.display="";
}

function expTxtAP(id){
document.getElementById(id+"_Answer").style.display="inline";
document.getElementById(id+"_Question").style.display="none";
}

function colTxtAP(id){
document.getElementById(id+"_Answer").style.display="none";
document.getElementById(id+"_Question").style.display="inline";
}

function expTxt2(id){
document.getElementById(id+"_Answer").style.display="inline";
}

function colTxt2(id){
document.getElementById(id+"_Answer").style.display="none";
}



function clearValue(element,chkValue) {
	if (element.value==chkValue) {
		element.value="";
	}
}

function checkValue(element,chngValue){
	if (element.value=="") {
		element.value=chngValue;
	}
}

function eventsShow() {
	document.getElementById("homeNewsRightContent").innerHTML = "<div class=\"text\"><span id=\"newsRightNews\">Events</span> | <span id=\"newsRightEvents'\"><a href=\"javascript: void(0);\" onClick=\"ajaxRequest('/ajax/homepageNewsEvents.asp?show=News','newsEventsHolder'); newsShow();\">News</a></span></div>";
}

function newsShow() 	{
	document.getElementById("homeNewsRightContent").innerHTML = "<div class=\"text\"><span id=\"newsRightNews\"><a href=\"javascript: void(0);\" onClick=\"ajaxRequest('/ajax/homepageNewsEvents.asp?show=Events','newsEventsHolder'); eventsShow();\">Events</a></span> | <span id='newsRightEvents'>News</span></div>";
}

var xmlhttp;
var ajaxDivId;
function ajaxRequest(url,divId){
	xmlhttp=null;
	ajaxDivId = divId
	if (window.XMLHttpRequest)
	{// code for Firefox, Opera, IE7, etc.
	xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{// code for IE6, IE5
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (xmlhttp!=null)
	{
	xmlhttp.onreadystatechange = state_Change;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}
	else
	{
	alert("Your browser does not support XMLHTTP.");
	}
}


function state_Change(){
	if (xmlhttp.readyState==4)
	{// 4 = "loaded"
	if (xmlhttp.status==200)
	{// 200 = "OK"
	document.getElementById(ajaxDivId).innerHTML=xmlhttp.responseText;
	}
	else
	{
	alert("Problem retrieving data:" + xmlhttp.statusText);
	}
	}
}

var pickedUp = new Array("", false);

function getReadyToMove(element, evt) {
	pickedUp[0] = element;
	pickedUp[1] = true;
}

function checkLoadedObjects(evt) {
	if (pickedUp[1] == true) {
	var currentSelection = document.getElementById(pickedUp[0]);
	
	currentSelection.style.top = (evt.clientY - 45) + "px";
	currentSelection.style.left = (evt.clientX - 260) + "px";
	}
}

function dropLoadedObject(evt) {
	if (pickedUp[1] == true) {
	var currentSelection = document.getElementById(pickedUp[0]);
	currentSelection.style.top = (evt.clientY - 45) + "px";
	currentSelection.style.left = (evt.clientX - 260) + "px";
	
	pickedUp = new Array("", false);
	}
}

function closeWindow(elementId) {
	var agt=navigator.userAgent.toLowerCase();
	var currentSelection = document.getElementById(elementId);
	currentSelection.style.display='none';
}

// Copyright 2006-2007 javascript-array.com

var timeout	= 0;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 

function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}

function submitPage() {
	$("#submitImage").toggle();
	$("#submitProcessing").toggle();
}

function submitPage2() {
	document.getElementById("submitImage2").style.display = "none";
	document.getElementById("submitProcessing2").style.display = "";
}

function openWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openImageBox(divId, divPosition){
	var options1 = {
		direction:  'right'
	}
	var options2 = {
		direction:  'left'
	}
	if (divPosition == 'left') {
		$('#' + divId).popeye(options2);
	}else{
		$('#' + divId).popeye(options1);
	}
}

function ajaxRequestCountdownStarting(url,divId){
	xmlhttp=null;
	ajaxDivId = divId
	if (window.XMLHttpRequest)
	{// code for Firefox, Opera, IE7, etc.
	xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{// code for IE6, IE5
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (xmlhttp!=null)
	{
	xmlhttp.onreadystatechange = state_Change;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}
	else
	{
	alert("Your browser does not support XMLHTTP.");
	}
	var tempFunction = function() {
	//Due to closures, outputVar will be populated
	theDate = new Date();
    theDate = theDate.valueOf();
	ajaxRequestCountdownStarting('/ajax/countdownclockStarting.asp?' + theDate,'countdown');
	};
	setTimeout(tempFunction, 1000);
}

function ajaxRequestCountdownEntry(url,divId){
	xmlhttp=null;
	ajaxDivId = divId
	if (window.XMLHttpRequest)
	{// code for Firefox, Opera, IE7, etc.
	xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{// code for IE6, IE5
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (xmlhttp!=null)
	{
	xmlhttp.onreadystatechange = state_Change;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}
	else
	{
	alert("Your browser does not support XMLHTTP.");
	}
	var tempFunction = function() {
	//Due to closures, outputVar will be populated
	theDate = new Date();
    theDate = theDate.valueOf();
	ajaxRequestCountdownEntry('/ajax/countdownclockEntry.asp?' + theDate,'countdown');
	};
	setTimeout(tempFunction, 1000);
}

function ajaxRequestCountdownVoting(url,divId){
	xmlhttp=null;
	ajaxDivId = divId
	if (window.XMLHttpRequest)
	{// code for Firefox, Opera, IE7, etc.
	xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{// code for IE6, IE5
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (xmlhttp!=null)
	{
	xmlhttp.onreadystatechange = state_Change;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}
	else
	{
	alert("Your browser does not support XMLHTTP.");
	}
	var tempFunction = function() {
	//Due to closures, outputVar will be populated
	theDate = new Date();
    theDate = theDate.valueOf();
	ajaxRequestCountdownVoting('/ajax/countdownclockVoting.asp?' + theDate,'countdownVoting');
	};
	setTimeout(tempFunction, 1000);
}

function ajaxRequestFacebook(url,divId){
	xmlhttp=null;
	ajaxDivId = divId
	if (window.XMLHttpRequest)
	{// code for Firefox, Opera, IE7, etc.
	xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{// code for IE6, IE5
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (xmlhttp!=null)
	{
	xmlhttp.onreadystatechange = state_ChangeFacebook;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}
	else
	{
	alert("Your browser does not support XMLHTTP.");
	}
}

function state_ChangeFacebook(){
	if (xmlhttp.readyState==4)
	{// 4 = "loaded"
	if (xmlhttp.status==200)
	{// 200 = "OK"
	document.getElementById(ajaxDivId).innerHTML=xmlhttp.responseText;
	$('.fbActivity[title]').tooltip({ position: 'bottom center', offset: [20, 0], effect: 'fade'});
	}
	else
	{
	alert("Problem retrieving data:" + xmlhttp.statusText);
	}
	}
}

function ajaxRequestHomePet(url,divId){
	xmlhttp=null;
	ajaxDivId = divId
	if (window.XMLHttpRequest)
	{// code for Firefox, Opera, IE7, etc.
	xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{// code for IE6, IE5
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (xmlhttp!=null)
	{
	xmlhttp.onreadystatechange = state_ChangeHomePet;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}
	else
	{
	alert("Your browser does not support XMLHTTP.");
	}
}

function state_ChangeHomePet(){
	if (xmlhttp.readyState==4)
	{// 4 = "loaded"
	if (xmlhttp.status==200)
	{// 200 = "OK"
	document.getElementById(ajaxDivId).innerHTML=xmlhttp.responseText;
	setTimeout('$(\'#recentPetsContCont\').fadeIn()', 200);
	}
	else
	{
	alert("Problem retrieving data:" + xmlhttp.statusText);
	}
	}
}

var rotatePos = 1;
var numPosters = 0;
var rotating = 0;
var autoTime = 10000;
var stopped = 0;
function rotateRight(type){
	var numLeft;
	var rotatePx;
	if (stopped==0||type=="click"){
		if (rotating != 1){
			rotating=1;
			numLeft = numPosters - rotatePos;
			document.getElementById("circle_" + rotatePos).src="/images/circle2.png";
			switch(numLeft)
			{
			default:
			  rotatePx = 213;
			  rotatePos = rotatePos + 1;
			}
			if (rotatePos == (numPosters+1)){
				rotatePx = rotatePx * (numPosters-1);
				jQuery('#homeScroll').animate({'left':'+=' + rotatePx + 'px'});
				rotatePos = 1;
			}else{
				jQuery('#homeScroll').animate({'left':'-=' + rotatePx + 'px'});
			}
			document.getElementById("circle_" + rotatePos).src="/images/circle.png";
			setTimeout('resetRotate()',700);
		}
	}
	if (type=="auto") {
		if (stopped==0)
		{
			setTimeout("rotateRight('auto');",autoTime);
		}
	}else{
		stopped=1;	
	}
}
function rotateLeft(){
	var numLeft;
	var rotatePx;
	stopped=1;
	if (rotating != 1){
		rotating=1;
		numLeft = rotatePos - 1;
		document.getElementById("circle_" + rotatePos).src="/images/circle2.png";
		switch(numLeft)
		{
		default:
		  rotatePx = 213;
		  rotatePos = rotatePos - 1;
		}
		if (rotatePos == 0){
			rotatePx = rotatePx * (numPosters-1);
			jQuery('#homeScroll').animate({'left':'-=' + rotatePx + 'px'});
			rotatePos = numPosters;
		}else{
			jQuery('#homeScroll').animate({'left':'+=' + rotatePx + 'px'});
		}
		document.getElementById("circle_" + rotatePos).src="/images/circle.png";
		setTimeout('resetRotate()',700);
	}
}

function resetRotate() {
	rotating=0;
}

function isSecure()
{
   return window.location.protocol == 'https:';
}

//-->

