﻿// JScript File
function switchToActiveTab(obj)
{
    document.getElementById('activeTab').id='';
    obj.id='activeTab';
    return false;
}
function showhideContent(contentId,linkId)
{
    var cont = document.getElementById(contentId);
    var link = document.getElementById(linkId);
    
    if (cont.style.display == 'inline')
    {
        cont.style.display = 'none';
        link.innerHTML = "(more)";
    }
    else
    {
        cont.style.display = 'inline';
        link.innerHTML = "(less)";
    }
}
function switchCursor(theImage)
{
	if (navigator.appVersion.indexOf("MSIE")!=-1)  // For IE
	{
		theImage.style.cursor='hand';
		theImage.style.cursor='pointer';		
	}
	else										// For Other browsers
	{
		theImage.style.cursor='pointer';		
	}
}
function submitenter(myfield,e)
{
    var keycode;
    if (window.event) keycode = window.event.keyCode;
    else if (e) keycode = e.which;
    else return true;

    if (keycode == 13)
       {
           myfield.form.submit();
           return false;
       }
    else
       return true;
}
function do_reset()
{
    document.getElementById("txtEmailAddress").value = "";
    document.getElementById("txtPassword").value = "";
    return false;
}
function do_submit()
{
    var email_address = document.getElementById("txtEmailAddress").value;
    var pass = document.getElementById("txtPassword").value;
    if(email_address == "" || pass == "")
    {
        alert('Please enter email address and password.');
        return false;
    }
    else
        return true;    
}
//helper function to create the form
function getNewSubmitForm(){
 var submitForm = document.createElement("FORM");
 document.body.appendChild(submitForm);
 submitForm.method = "POST";
 return submitForm;
}

//helper function to add elements to the form
function createNewFormElement(inputForm, elementName, elementValue){
 var newElement = document.createElement("<input name='"+elementName+"' type='hidden'>");
 inputForm.appendChild(newElement);
 newElement.value = elementValue;
 return newElement;
}

//function that creates the form, adds some elements
//and then submits it
function createFormAndSubmit(actionURL){
debugger
 var submitForm = getNewSubmitForm();
 var accessCode = document.getElementById("txtPromoCode").value;
 createNewFormElement(submitForm, "promo_code_input", accessCode);
 submitForm.action= actionURL;
 submitForm.submit();
}
function trailerpopup(fil)
 {
	mywindow = window.open (fil, 'mywindow','location=1,status=0,scrollbars=0,width=580,height=367,left=0,top=100,screenX=0,screenY=100');	
	//mywindow.moveTo(0,0);
 } 
 
function TriggerButtonClick(btnID, event)
{
	if(event.which || event.keyCode)
	{
		if ((event.which == 13) || (event.keyCode == 13)) 
		{	
			document.getElementById(btnID).click();
				return false;
		}
	} 
		else {return true;}
}

