var win=null;
function openWindow(mypage,myname,w,h,scroll,pos){
	if(pos=="center"){
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	}else if((pos!="center" && pos!="random") || pos==null){
		LeftPosition=0;TopPosition=20
 	}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);
	if(win.focus){
		win.focus();
	}
}

function closeQuestionnaire() {
	document.getElementById("qpop").style.visibility = "hidden";
}

function checkPollForm() {
	ePollForm = document.pollfrm;
	var iOption = "";
	for (var i = 0; i < ePollForm.iOptionID.length; i++)
		if (ePollForm.iOptionID[i].checked)
			iOption = ePollForm.iOptionID[i].value;
	
	if (!iOption.length)
		alert("Please select an option.");
	else {
		ePollForm.action = "poll_submit.asp";
		ePollForm.submit();
	}	
}


// jquery stuff
$(document).ready(function(){
  if($(".lightbox").length > 0){
		$(".lightbox").lightbox();
  }
  
		// Preload all rollovers
		$(".thumb-collection img").each(function() {
			// Set the original src
			rollsrc = $(this).attr("src");
			rollON = rollsrc.replace('_thumb', '_over');
			newImg = new Image(); // create new image obj
			$(newImg).attr("src", rollON); // set new obj's src
			
		});

		
		// Navigation rollovers
		$(".thumb-collection a").mouseover(function(){
			imgsrc = $(this).children("img").attr("src");
			
			if (typeof(imgsrc) != 'undefined') {
			imgsrcON = imgsrc.replace('_thumb', '_over');
			$(this).children("img").attr("src", imgsrcON);
			}
			
		});
		
		// Handle mouseout
		$(".thumb-collection a").mouseout(function(){
			if (typeof(imgsrc) != 'undefined') {
			$(this).children("img").attr("src", imgsrc);
			}
		});

		// For URL's to viostream videos in videoplayer
		
	/*$("a.iframe").each(function(){
		var vioUID = $(this).attr("href");
	
		// alert(vioUID);
		$(this).attr("href",fnSwapURL(vioUID));

	});*/
		

	
});
	
	

	

