function embedObject(flash_file, width, height) {
	document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"'+width+'\" height=\"'+height+'\">' +
	'    <param name=\"movie\" value=\"'+flash_file+'\" />' +
	'    <param name=\"quality\" value=\"high\" />' +
	'	 <param name=\"wmode\" value=\"transparent\" />' +
	'    <embed src=\"'+flash_file+'\" quality=\"high\" wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"'+width+'\" height=\"'+height+'\"></embed>' +
	'  </object>');
}
function AjaxDeleteSession(id){
	$.post('/ajax/delsess/'+id+'/', function(data){
		if(data != 'none'){
			alert(data);
		}
	});
}
function val_email(ele) {
    if (/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($(ele).val()) == false){
        return false;
    }
    else{
	   return true;
    }
}
function validateMLM() {
    if($('#mlm_first_name').val() == '' || $('#mlm_first_name').val() == 'Name'){
        alert('Please enter your name.');
    } else if($('#mlm_last_name').val() == '' || $('#mlm_last_name').val() == 'Surname'){
        alert('Please enter your surname.');
    } else if($('#mlm_email').val() == '' || $('#mlm_email').val() == 'Email Address'){
        alert('Please enter your email address.');
    } else if(val_email('#mlm_email') == false){
        alert('Please enter a valid email address.');
    } else {
        $('#MLMForm').submit();
    }
}
function validateContact() {
	
    if($('#contact_first_name').val() == '' || $('#contact_first_name').val() == 'First Name'){
        alert('Please enter your name.');
    } else if($('#contact_last_name').val() == '' || $('#contact_last_name').val() == 'Surname'){
        alert('Please enter your surname.');
    } else if($('#contact_number').val() == '' || $('#contact_number').val() == 'Contact Number'){
        alert('Please enter your contact number.');
    } else if($('#contact_email').val() == '' || $('#contact_email').val() == 'Email Address'){
        alert('Please enter your email address.');
    } else if(val_email('#contact_email') == false){
        alert('Please enter a valid email address.');
    } else if($('#contact_comments').val() == '' || $('#contact_comments').val() == 'Comments'){
        alert('Please enter your comments.');
    } else {
        $('#contact').submit();
    }
}