// JavaScript Document


/***************************************************************
*                                                              *
*                         HighSlide                            *
*                                                              *
***************************************************************/

	hs.graphicsDir = 'template/images/graphics/';
	hs.showCredits = false;
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
	hs.fadeInOut = true;
	hs.dimmingOpacity = 0.8;
	hs.outlineType = 'rounded-white';
	hs.captionEval = 'this.thumb.alt';
	hs.marginBottom = 105 // make room for the thumbstrip and the controls
	hs.numberPosition = 'caption';

	// Add the slideshow providing the controlbar and the thumbstrip
	hs.addSlideshow({
		//slideshowGroup: 'group1',
		interval: 3000,
		repeat: false,
		useControls: true,
		overlayOptions: {
			className: 'text-controls',
			position: 'bottom center',
			relativeTo: 'viewport',
			offsetY: -60

		},
		thumbstrip: {
			position: 'bottom center',
			mode: 'horizontal',
			relativeTo: 'viewport'
		}
	});

<!-- Start Message Box //-->
function messageBoxLogin(id,num,msg){
var id = id;
var num = num;
var msg = msg;

	if(id == 'processing'){
			html = '<div class="msg-box-cont msg-login-'+id+'" id="msgbox_registration_warning_box">';
			html = html +'<table width="100%" border="0" cellpadding="0" cellspacing="0">';
			html = html +'<tr>';
			html = html +'<td width="98%"><div style="color:rgb(120,0,0);font-size:60%;font-weight:bold;"><div id="icon" class="process-icon"></div>Login in progress</div></td>';
			html = html +'</tr>';
			html = html +'</table>';
			html = html +'</div>';
	} else {
		if(id == 'success'){
			msg = 'Thank you for your interest in The Seminole Tribe of Florida Jason Taylor Sack Pack Presented by Office Depot Foundation, a representative will contact you as soon as possible.';
			getInfo();		
			} else if(id == 'warning'){
				if(num == 100){
					msg = '<b>Error:100</b> Sorry, we are unable to process this request';
				} else {
					msg = msg;
				}
		} else if(id == 'info'){
			msg = 'Please input all required information prior to submitting the form.';
		} 	
			html = '<div class="msg-box-cont msg-login-'+id+'" id="msgbox_registration_warning_box">';
			html = html +'<table width="100%" border="0" cellpadding="0" cellspacing="0">';
			html = html +'<tr>';
			html = html +'<td width="98%"><div style="color:rgb(120,0,0);font-size:60%;font-weight:bold;"><div id="icon" class="msg-icon msg-icon-'+id+'"></div>'+msg+'</div></td>';
			html = html +'</tr>';
			html = html +'</table>';
			html = html +'</div>';

	}
	
	$("#msgLogin").html(html);
	
}
<!-- End Message Boc //-->


<!-- Start Process Form //-->
function process_login(){ //validate form entriesvar
		
		messageBoxLogin('processing');
		
		var	name = $("#username").val();
		var	password = $("#password").val();
		var error = new Array();
		var errorArr = '';
		
		if(name == ''){
			error[0] = 'A user name is required!';
		}else{
			error[0] = '';
		}
		
		if(password == ''){
			error[1] = 'A password is required!';
		}else{
			error[1] = '';
		}
					
		for( var i=0; i<error.length; i++){
			if(error[i] != ''){
				errorArr += error[i]+'<br />';
			}
		} 
	
			var errLen = errorArr.length;
			var errorLen = errLen - 2 * 1;
			var error = '<div style="margin-left:30px;">'+errorArr.substr(0,errorLen)+'</div>';
			if(errorArr != ''){
				$('#msgLogin').css({display:"block",marginBottom:"-25px"});
				messageBoxLogin('warning','',error);
				return false;
			}else{
				$('#msgLogin').css({display:"block",marginBottom:"-25px"});
				messageBoxLogin('processing');
				$.ajax({
					url:       'scripts/process_login/',         // override for form's 'action' attribute 
					type:      'post',        // 'get' or 'post', override for form's 'method' attribute 
					dataType:  'html',        // 'xml', 'script', or 'json' (expected server response type) 
					data: 	   'action=process_login&name='+name+'&password='+password,
					success: (function(responseText) { 
               		// alert(responseText);
						if(responseText == 'success'){ 
						 window.location.reload();
						} else {
							messageBoxLogin('warning',100);
						}
					 })
			   });
			}
}
<!-- End Process Form //-->

	
	
function forward_partner(id){
	var id = id;
	$.ajax({
		url:       'scripts/process_partner.php',         // override for form's 'action' attribute 
		type:      'post',        // 'get' or 'post', override for form's 'method' attribute 
		dataType:  'html',        // 'xml', 'script', or 'json' (expected server response type) 
		data: 	   'action=process_forward&id='+id,
		success: function(responseText){
			window.location='http://'+responseText;
		}
   });
}	

<!-- Start Logout //-->
function logout(){
	$.ajax({
		url:       'scripts/process_login/',         // override for form's 'action' attribute 
		type:      'post',        // 'get' or 'post', override for form's 'method' attribute 
		dataType:  'html',        // 'xml', 'script', or 'json' (expected server response type) 
		data: 	   'action=process_logout',
		success: (function() { 
			 window.location.reload();
		 })
   });
}
<!-- End Logout //-->

	
function process_offer(id){
	var id = id;
	$.ajax({
		url:       'scripts/process_partner/',         // override for form's 'action' attribute 
		type:      'post',        // 'get' or 'post', override for form's 'method' attribute 
		dataType:  'html',        // 'xml', 'script', or 'json' (expected server response type) 
		data: 	   'action=process_offer&id='+id,
		success: (function(responseText){
			if(responseText == 'success'){
				MM_openBrWindow('coupon.php?id='+id,'coupon','scrollbars=yes,width=600,height=400');
			}
		})
   });
}	


<!-- Start Process Form //-->
function process_contact_form(){ 
		$("#p_btn_submit").html('Please stand by...');
		
		var	name = $("#name").val();
		var	email = $("#email").val();
		var	phone = $("#phone").val();
		var	comment = $("#comment").val();
		var error = new Array();
		var errorArr = '';
		var count = 0;
		
		if(name == ''){
			error[count] = 'A name is required';
			count++;
		}
		
		if(email == ''){
			error[count] = 'An email address is required';
			count++;
		}
		
		if(comment == ''){
			error[count] = 'A comment is required';
			count++;
		}
					
		for( var i=0; i<error.length; i++){
			if(error[i] != ''){
				errorArr += error[i]+'<br />';
			}
		} 
	
			var errLen = errorArr.length;
			var errorLen = errLen - 2 * 1;
			var error = '<div style="margin-left:30px;">'+errorArr.substr(0,errorLen)+'</div>';
			
			if(errorArr != ''){
				jError(error,'Error');
				$("#p_btn_submit").html('Submit');
			}else{
				var str = $("form[id='contact']").serialize();
				//jAlert(str);
				$.ajax({
					url:       'scripts/process_contact/',         // override for form's 'action' attribute 
					type:      'post',        // 'get' or 'post', override for form's 'method' attribute 
					dataType:  'html',        // 'xml', 'script', or 'json' (expected server response type) 
					data: 	   'action=process_contact&'+str,
					success:(function(responseText) { 
						if(responseText == 'success'){ 
							jAlert('Your message has been sent');
							$("#p_btn_submit").html('Submit');
							setTimeout(window.location.reload(),5000);
						} else {
							//jAlert(responseText);
							jError('System Error, your message was not sent','Error');
							$("#p_btn_submit").html('Submit');
						}
					})
			   });
			}
}
<!-- End Process Form //-->
function clearForm() {
	$('#contact').resetForm();
}


