// JavaScript Document
var firsttime = true;

// Start Video Player Popup
var user_video_win; 
function user_video_overlay(){
	user_video_win=dhtmlmodal.open("My Story","div","user_video_overlay_div"," ", "width=558px, height=572px,center=1,resize=0,scrolling=0,style='margin:0px; padding:0px; background:none;'", "recal");
}

//parent.user_video_win.hide();

/*** Submit Entry Now Normal and Hover Effects ***/
function submit_entry_now_normalEffect(id){
	document.getElementById(id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/button/submit_enter_now.png";
	document.getElementById(id).width="200";
	document.getElementById(id).height="48";		
}
function submit_entry_now_hoverEffect(id){
	document.getElementById(id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/button/submit_enter_now_hover.png";
	document.getElementById(id).width="200";
	document.getElementById(id).height="48";
}
/*** End ***/

/*** Enter Now Big Normal and Hover Effects ***/
function enter_now_big_normalEffect(id){
	document.getElementById(id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/button/enter_now_big.png";
	document.getElementById(id).width="182";
	document.getElementById(id).height="28";		
}
function enter_now_big_hoverEffect(id){
	document.getElementById(id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/button/enter_now_big_hover.png";
	document.getElementById(id).width="182";
	document.getElementById(id).height="28";
}
/*** End ***/

/*** Star Normal and Hover Effects ***/
function star_normalEffect2(staractivecnt){
	var star_id="";
	for(i=1;i<=5;i++){
		star_id="star_"+i;
		var imgurl = "http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/";
		if (i<=straactivecnt) {
			imgurl += "star_hover.png";
		}
		else {
			imgurl += "star.png";
		}
		document.getElementById(star_id).src=imgurl;
		document.getElementById(star_id).width="30";
		document.getElementById(star_id).height="30";
		star_id="";
	}
}
function star_hoverEffect2(id, staractivecnt){
	var star_id="";
	for(i=1;i<=id;i++){
		star_id="star_"+i;
		document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star_hover.png";
		document.getElementById(star_id).width="30";
		document.getElementById(star_id).height="30";
		star_id="";
	}
	if (firsttime) {
		firsttime = false;
		for(i=id+1;i<=staractivecnt;i++){
			star_id="star_"+i;
			document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star.png";
			document.getElementById(star_id).width="30";
			document.getElementById(star_id).height="30";
			star_id="";
		}
	}
}

function star_hoverEffectOld2(id, staractivecnt){
	var star_id="";
	switch(id){
		case "1":
			for(i=1;i<=1;i++){
				star_id="star_"+i;
				document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star_hover.png";
				document.getElementById(star_id).width="30";
				document.getElementById(star_id).height="30";
				star_id="";
			}
			if (firsttime) {
				firsttime = false;
				for(i=2;i<=staractivecnt;i++){
					star_id="star_"+i;
					document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star.png";
					document.getElementById(star_id).width="30";
					document.getElementById(star_id).height="30";
					star_id="";
				}
			}
			break;
		case "2":
			for(i=1;i<=2;i++){
				star_id="star_"+i;
				document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star_hover.png";
				document.getElementById(star_id).width="30";
				document.getElementById(star_id).height="30";
				star_id="";
			}
			if (firsttime) {
				firsttime = false;
				for(i=3;i<=staractivecnt;i++){
					star_id="star_"+i;
					document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star.png";
					document.getElementById(star_id).width="30";
					document.getElementById(star_id).height="30";
					star_id="";
				}
			}
			break;
		case "3":
			for(i=1;i<=3;i++){
				star_id="star_"+i;
				document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star_hover.png";
				document.getElementById(star_id).width="30";
				document.getElementById(star_id).height="30";
				star_id="";
			}
			if (firsttime) {
				firsttime = false;
				for(i=4;i<=staractivecnt;i++){
					star_id="star_"+i;
					document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star.png";
					document.getElementById(star_id).width="30";
					document.getElementById(star_id).height="30";
					star_id="";
				}
			}
			break;
		case "4":
			for(i=1;i<=4;i++){
				star_id="star_"+i;
				document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star_hover.png";
				document.getElementById(star_id).width="30";
				document.getElementById(star_id).height="30";
				star_id="";
			}
			if (firsttime) {
				firsttime = false;
				for(i=5;i<=staractivecnt;i++){
					star_id="star_"+i;
					document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star.png";
					document.getElementById(star_id).width="30";
					document.getElementById(star_id).height="30";
					star_id="";
				}
			}
			break;
		case "5":
			for(i=1;i<=5;i++){
				star_id="star_"+i;
				document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star_hover.png";
				document.getElementById(star_id).width="30";
				document.getElementById(star_id).height="30";
				star_id="";
			}
			break;	
	}
}

function star_normalEffect(id){
	var star_id="";
	switch(id){
		case "1":
			for(i=1;i<=1;i++){
				star_id="star_"+i;
				document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star.png";
				document.getElementById(star_id).width="30";
				document.getElementById(star_id).height="30";
				star_id="";
			}
			break;
		case "2":
			for(i=1;i<=2;i++){
				star_id="star_"+i;
				document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star.png";
				document.getElementById(star_id).width="30";
				document.getElementById(star_id).height="30";
				star_id="";
			}
			break;
		case "3":
			for(i=1;i<=3;i++){
				star_id="star_"+i;
				document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star.png";
				document.getElementById(star_id).width="30";
				document.getElementById(star_id).height="30";
				star_id="";
			}
			break;
		case "4":
			for(i=1;i<=4;i++){
				star_id="star_"+i;
				document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star.png";
				document.getElementById(star_id).width="30";
				document.getElementById(star_id).height="30";
				star_id="";
			}
			break;
		case "5":
			for(i=1;i<=5;i++){
				star_id="star_"+i;
				document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star.png";
				document.getElementById(star_id).width="30";
				document.getElementById(star_id).height="30";
				star_id="";
			}
			break;	
	}		
}
function star_hoverEffect(id){
	var star_id="";
	switch(id){
		case "1":
			for(i=1;i<=1;i++){
				star_id="star_"+i;
				document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star_hover.png";
				document.getElementById(star_id).width="30";
				document.getElementById(star_id).height="30";
				star_id="";
			}
			break;
		case "2":
			for(i=1;i<=2;i++){
				star_id="star_"+i;
				document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star_hover.png";
				document.getElementById(star_id).width="30";
				document.getElementById(star_id).height="30";
				star_id="";
			}
			break;
		case "3":
			for(i=1;i<=3;i++){
				star_id="star_"+i;
				document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star_hover.png";
				document.getElementById(star_id).width="30";
				document.getElementById(star_id).height="30";
				star_id="";
			}
			break;
		case "4":
			for(i=1;i<=4;i++){
				star_id="star_"+i;
				document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star_hover.png";
				document.getElementById(star_id).width="30";
				document.getElementById(star_id).height="30";
				star_id="";
			}
			break;
		case "5":
			for(i=1;i<=5;i++){
				star_id="star_"+i;
				document.getElementById(star_id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/user_video/star_hover.png";
				document.getElementById(star_id).width="30";
				document.getElementById(star_id).height="30";
				star_id="";
			}
			break;	
	}
}
/*** End ***/

/*** Enter Now Small Normal and Hover Effects ***/
function enter_now_small_normalEffect(id){
	document.getElementById(id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/button/enter_now_small.png";
	document.getElementById(id).width="122";
	document.getElementById(id).height="28";		
}
function enter_now_small_hoverEffect(id){
	document.getElementById(id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/button/enter_now_small_hover.png";
	document.getElementById(id).width="122";
	document.getElementById(id).height="28";
}
/*** End ***/

/*** Continue Normal and Hover Effects ***/
function continue_normalEffect(id){
	document.getElementById(id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/button/continue.png";
	document.getElementById(id).width="74";
	document.getElementById(id).height="22";		
}
function continue_hoverEffect(id){
	document.getElementById(id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/button/continue_hover.png";
	document.getElementById(id).width="74";
	document.getElementById(id).height="22";
}
/*** End ***/

/*** Empty Captcha Field ***/
var empty_captcha=true;
function emptyField(obj){
	if(empty_captcha){
		obj.value="";
		empty_captcha=false;
	}
}
/*** End ***/

/*** Show Captcha Div ***/
function show_captchaDiv(){
	document.getElementById("ratingDiv").style.display="none";
	document.getElementById("captchaDiv").style.display="block";
	document.reg.captcha.value='Type the characters.';
}
/*** End ***/

/*** Show Thanks for Rating Div ***/
function show_thanks_for_ratingDiv(){
	document.getElementById("captchaDiv").style.display="none";
	document.getElementById("thanks_for_ratingDiv").style.display="block";
}
function show_thanks_for_ratingNoSweepsDiv(){
	document.getElementById("captchaDiv").style.display="none";
	document.getElementById("thanks_for_ratingNoSweepsDiv").style.display="block";
}

/*** End ***/

/*** Browse Normal and Hover Effects ***/
function browse_normalEffect(id){
	document.getElementById(id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/button/browse.png";
	document.getElementById(id).width="63";
	document.getElementById(id).height="21";		
}
function browse_hoverEffect(id){
	document.getElementById(id).src="http://areatech.hs.llnwd.net/e1/motorsmaster/images/button/browse_hover.png";
	document.getElementById(id).width="63";
	document.getElementById(id).height="21";
}
/*** End ***/

/*** Set Width after On Change Event (Dynamically Elements are loaded) **/
function setWidth(){
	document.getElementById("modificationDiv_1").getElementsByTagName("span")[1].getElementsByTagName("select")[0].className="modification_to_vehicle dropdownBg";
	document.getElementById("modificationDiv_2").getElementsByTagName("span")[1].getElementsByTagName("select")[0].className="modification_to_vehicle dropdownBg";
	document.getElementById("modificationDiv_3").getElementsByTagName("span")[1].getElementsByTagName("select")[0].className="modification_to_vehicle dropdownBg";
	
	document.getElementById("modificationDiv_1").getElementsByTagName("span")[1].getElementsByTagName("select")[0].getElementsByTagName("option")[0].innerHTML="Select One";
	document.getElementById("modificationDiv_2").getElementsByTagName("span")[1].getElementsByTagName("select")[0].getElementsByTagName("option")[0].innerHTML="Select One";
	document.getElementById("modificationDiv_3").getElementsByTagName("span")[1].getElementsByTagName("select")[0].getElementsByTagName("option")[0].innerHTML="Select One";
	
	document.getElementById("modificationDiv_1").getElementsByTagName("input")[0].className="type8";
	document.getElementById("modificationDiv_2").getElementsByTagName("input")[0].className="type8";
	document.getElementById("modificationDiv_3").getElementsByTagName("input")[0].className="type8";
}
/*** End ***/

/*** Setting Video Category Background ***/
function setVideoCategoryBg(type){
	switch(type){
		case "muscle_cars":
			document.getElementById("video_categoryBg").className="muscle_cars_video_categoryBg";
			break;
		case "street_racers":
			document.getElementById("video_categoryBg").className="street_racers_video_categoryBg";
			break;
		case "off_road":
			document.getElementById("video_categoryBg").className="off_road_video_categoryBg";
			break;
		case "motor_cycles":
			document.getElementById("video_categoryBg").className="motor_cycles_video_categoryBg";
			break;
	}
}
/*** End ***/
