function loadHome() {
	window.open('index.asp','Home','fullscreen=yes,scrollbars=no');
}

function closeWindow() {
	window.close();
}

function openWindow(url) {
	window.open(url,'Submenus','fullscreen=yes,scrollbars=no');
}

function openNewWindow(url, name, w, h) {
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	window.open(url,name,'scrollbars=no,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function openEcards(a) {
	var sl = a.selectedIndex
	var url = "e-cards.asp?EcardsCategoryID=" + a[sl].value
	parent.location = url
}

function goToURL(url) {	
	parent.location = url
}

function openLogin() {	
	window.opener.location = "login.asp"
	window.close()
}

function openBollywoodNews(id) {
	h = 480
	w = 640
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	url = "bollywoodnews-content.asp?BollywoodNewsID=" + id
	window.open(url,"BollywoodNews",'scrollbars=no,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function openFeaturesReviews(id) {
	h = 480
	w = 640
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	url = "features-reviews-content.asp?FeaturesReviewsID=" + id
	window.open(url,"FeaturesReviews",'scrollbars=no,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function openFashion(id) {
	h = 480
	w = 640
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	url = "fashion-content.asp?FashionID=" + id
	window.open(url,"Fashion",'scrollbars=no,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function openNews(id) {
	h = 480
	w = 640
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	url = "news-content.asp?NewsID=" + id
	window.open(url,"News",'scrollbars=no,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function openReviews(id) {
	h = 480
	w = 640
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	url = "reviews-content.asp?ReviewsID=" + id
	window.open(url,"Reviews",'scrollbars=no,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function openEvents(id) {
	h = 480
	w = 640
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	url = "events-content.asp?EventsID=" + id
	window.open(url,"Events",'scrollbars=no,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function openMusicTrivia(id) {
	h = 480
	w = 640
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	url = "music-trivia-content.asp?MusicTriviaID=" + id
	window.open(url,"MusicTrivias",'scrollbars=no,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function openJokes() {
	h = 480
	w = 640
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	url = "jokes-content.asp"
	window.open(url,"Jokes",'scrollbars=no,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function openSongs(id) {
	h = 480
	w = 640
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	url = "songs-content.asp?SongsID=" + id
	window.open(url,"Songs",'scrollbars=no,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function openPage(url) {
	h = 480
	w = 640
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	window.open(url,"Registration",'scrollbars=no,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function postComments(id, page) {
	h = 480
	w = 640
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	url = "videos-comments-post.asp?Page=" + page + "&VideoID=" + id
	window.open(url,"Comments",'scrollbars=no,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function postSlamComments(id) {
	h = 480
	w = 640
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	url = "slam-comments-post.asp?SlamBookID=" + id
	window.open(url,"SlamComments",'scrollbars=no,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function postTopicComments(id) {
	h = 480
	w = 640
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	url = "forum-comments-post.asp?TopicID=" + id
	window.open(url,"ForumComments",'scrollbars=no,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function postBlogComments(id) {
	h = 480
	w = 640
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	url = "blog-comments-post.asp?BlogID=" + id
	window.open(url,"BlogComments",'scrollbars=no,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function openFooter(url) {
	h = 480
	w = 640
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	window.open(url,"Footer",'scrollbars=yes,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function openFooterS(url) {
	h = 480
	w = 660
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	window.open(url,"Footer",'scrollbars=yes,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function openFooterB(url) {
	h = 480
	w = 720
	hH = h / 2
	hW = w / 2
	top1 = (screen.height/2) - hH
	left1 = (screen.width/2) - hW
	window.open(url,"Footer",'scrollbars=yes,width='+w+',height='+h+',left='+left1+',top='+top1+'');
}

function selectDate(mc) {
	if (mc.selectedIndex != 0) {
		var dt = mc[mc.selectedIndex].value
		parent.location = "winners-date.asp?Dates=" + dt
	}
}

function selectContest(mc) {
	if (mc.selectedIndex != 0) {
		var ct = mc[mc.selectedIndex].value
		parent.location = "winners.asp?ContestID=" + ct
	}
}

function closeComments(path){
	window.opener.location = "videos-comments.asp?" + path
	window.close()
}

function closeSlamComments(id){
	window.opener.location = "slambook-view.asp?SlamBookID=" + id
	window.close()
}

function closeTopicComments(id){
	window.opener.location = "forum-comments.asp?TopicID=" + id
	window.close()
}

function closeBlogComments(id){
	window.opener.location = "blogs.asp?BlogID=" + id
	window.close()
}

function submitForm() {
	document.form1.submit();
}

function IsEmail(val) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(val)) {
		return true
	} else {
		return false
	}
}

function validateForm() {
	success = false
	for (i=0; i<arguments.length; i++) {
		var inputSelect = arguments[i]
		var input = inputSelect.split("-")
		var inputName = input[0]
		var inputType = input[1]
		var inputStr = input[2]
		var inputLength = Number(input[3])
		var inputValue = String(document.getElementById(input[0]).value)
		if (inputValue.length < inputLength) {
			alert("Please specify the " + inputStr)
			success = false
			break
		} else {
			if (inputType == "num") {
				var n = IsNumeric(inputValue)
				if (n == true) {
					success = true
				} else {
					alert(inputStr + " should be numeric")
					success = false
					break
				}
			} else if (inputType == "str") {			
				if (inputValue.length >= inputLength) {
					success = true
				} else {
					alert("Please specify the " + inputStr)
					success = false
					break
				}			
			} else 	if (inputType == "eml") {
				var e = IsEmail(inputValue)
				if (e == true) {
					success = true
				} else {
					alert("Please specify the " + inputStr)
					success = false
					break
				}
			} 
		}
	}
	return success
}