function bresize(){ // maximize screen
	self.moveTo(0,0);
	self.resizeTo(screen.availWidth,screen.availHeight);
}
function nueva(where){
	var nueva = window.open(where,"nueva",'fullscreen=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=200,height=240');
	nueva.moveTo(0,0);nueva.focus();
}
function register(where){
	var callback = window.open(where,"callback",'fullscreen=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=400,height=580');
	callback.moveTo(0,0);callback.focus();
}
function tc(where){
	var tc = window.open(where,"tc",'fullscreen=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=400,height=' + screen.availHeight);
	tc.moveTo(0,0);tc.focus();
}
function news(where){
	var tc = window.open(where,"news",'fullscreen=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=730,height=' + screen.availHeight);
	news.moveTo(0,0);news.focus();
}
function launchVideo(wName,wLoc) {
	vString = "videoview.asp?video=" + wLoc + "&keepThis=true&TB_iframe=true&height=306&width=400&";
	tb_show(wName,vString,false);
}
function showImage(wImage) {
	tb_show("","imageview.asp?i="+wImage+"&keepThis=true&TB_iframe=true&height=500&width=700",false);
}

//Send to friend actions
function sendToFriend(wImage) {
	$("#imagePath").val(wImage);
	tb_show("", "#TB_inline?height=350&width=400&inlineId=sendtofriend", false);
}
function noThanks() {
	location.search = "";
}
function thanksMsg() {
	var qString = location.search.substring(1);
	if (qString == "thankyou") {
		tb_show("", "#TB_inline?height=100&width=400&inlineId=sendtofriend_thanks", false);
		var time = setTimeout("noThanks()", 1500);
	}
}
function validateForm() {
	$("#sendform").validate({
		debug: true,
		errorPlacement: function(error, element) {
			error.insertBefore(element);
		}
	});
}
$(document).ready(function(){
	thanksMsg();
	validateForm();
});