function loginBox(item, type) {
	//console.log('Password running');
	var emailBox = $('UserEmail');	
	var passBox = $('UserPassword');
		
	if(item == 'email') {
		if(type == 1) {
			if(emailBox.value == 'Enter E-mail') {
				emailBox.value = '';
			}
		}
		
		if(type == 0) {
			if(emailBox.value == '') {
				emailBox.value = 'Enter E-mail'
			};
		}
	}
	
	if (item == 'pass') {
		if (type == 1) {
			if (passBox.value == 'Enter Password') {
			
				if (navigator.appName == "Microsoft Internet Explorer") {
					var input2 = passBox.cloneNode(false);
					input2.type = 'password';
					input2.value = '';
					passBox.parentNode.replaceChild(input2, passBox);
					
				}
				else {
					//If NON IE
					passBox.value = '';
					passBox.type = 'password'
				}
			}
		}
		
		if (type == 0) {
			if(passBox.value == '') {
				
				if (!navigator.appName == "Microsoft Internet Explorer") {
					//IF NON IE
					passBox.type = 'text';
					passBox.value = 'Enter Password';
					
				}
			}	
		}
	}
}

function merchandiseForm() {
	form = $('buyForm');
	form.submit();
}

function sendForm(button) {
	terms = document.getElementById('terms');
	if(terms.checked == false){
		alert('You must Accept Terms and Conditions to continue');
	return false;
	}
	var loader = $('loader');
	button.style.display = 'none';
	loader.style.display = 'block';
	return true;
}


function showComment(id) {
	
	//Hides all playing videos
	videos = $$('.commentVideo');
	videos.each( function(item) {
		item.style.display = 'none';
	}
	);
	images = $$('.commentImage');
	images.each( function(item) {
		//console.log(item.style.display);
		item.style.display = 'block';
	}
	);
	 
	//Show selected video
	image =$('pic'+id);
	image.style.display = 'none';
	video = $('video'+id);
	video.style.display = 'block';
}


function tiny_close() {
	simulateClick('hide');
}


//Simulates a click on any a element
function simulateClick(elId) {
	var evt;
	var el = document.getElementById(elId);
	if (document.createEvent){
		evt = document.createEvent("MouseEvents");
		evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
	}
	(evt)? el.dispatchEvent(evt):(el.click && el.click());
}

//Simulates click on original posting link
function itemPost() {
	simulateClick('postLink');
}

function resolutionCheck(){
	if ((screen.width < 1024) && (screen.height < 768)) {
		alert("OUR SITE REQUIRES AT LEAST 1024x768 SCREEN RESOLUTION. \r\nYou will not be able to perform most actions.  \r\nPlease consider changing your resolution to a higher setting.");
	}
}



