function a(){
	
}

function openPopUp(){
		
	var page = "test.html";
	var width = 700;
	var height = 620;
	var openWin = this.open(page, "testTitle", "toolbar=no, menubar=no ,location=no, scrollbars=yes, resizable=yes, width=" + width + ", height=" + height + ", top=" + (screen.height/2 - height/2) + ", left=" + (screen.width/2 - width/2) + "\""); 
	
//	alert(artistname + " " + itemname);
	
}

function backToTop() {
	var x1 = x2 = x3 = 0;
	var y1 = y2 = y3 = 0;

	if (document.documentElement) {
	x1 = document.documentElement.scrollLeft || 0;
	y1 = document.documentElement.scrollTop || 0;
	}

	if (document.body) {
	x2 = document.body.scrollLeft || 0;
	y2 = document.body.scrollTop || 0;
	}

	x3 = window.scrollX || 0;
	y3 = window.scrollY || 0;

	var x = Math.max(x1, Math.max(x2, x3));
	var y = Math.max(y1, Math.max(y2, y3));

	window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));

	if (x > 0 || y > 0) {
	window.setTimeout("backToTop()", 25);
	}
}



//-----------------------------------------------------------------------------------------------------

function submitform(){
	
	
	var missinginfo = "";
	
	if (document.getElementById('Name').value == "") {
		missinginfo = "Please fill in your name.";
	} else if (document.getElementById('Email').value == "") {
			missinginfo = "Please fill in your email.";
	} 

		if (missinginfo != "") {

			alert(missinginfo);
		}else { 
			
			if(window.ActiveXObject){

				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

			}else if(window.XMLHttpRequest){

				xmlhttp = new XMLHttpRequest();

			}


			var url = "_web/php/send.php";
			var sendvar = "Ref=" + document.getElementById('Ref').innerHTML 
			+ "&" + "Name=" + document.getElementById('Name').value 
			+ "&" + "Tel=" + document.getElementById('Tel').value 
			+ "&" + "Address=" + document.getElementById('Address').value 
			+ "&" + "Email=" + document.getElementById('Email').value 
			+ "&" + "Enquiry=" + document.getElementById('Enquiry').value;

			xmlhttp.open("POST", url, true);


			xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			xmlhttp.setRequestHeader("Content-length", sendvar.length);
			xmlhttp.setRequestHeader("Connection", "close");
			xmlhttp.onreadystatechange = delayProcess;
			xmlhttp.send(sendvar);




			document.getElementById('preloadArea').innerHTML = '<img src="web/img/preloader.gif"/>';
			
			
			
			
			
			
		
	}


	
}

function delayProcess(){
	setTimeout("processEnd()",500);
}


function processEnd() {
		

	if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
		
		
		
		
		
		document.getElementById('preloadArea').innerHTML = '';
		
		
		opacityTween = new OpacityTween(document.getElementById('enq_form'),Tween.cubicEaseOut, 100, 0, 0.2);
		opacityTween.start();
		
		
		
		var a = new Object();
		a.onMotionFinished = onFadeOutEnd;

		opacityTween.addListener(a);
		

	}

	
	
	
	
}


function onFadeOutEnd(){
	
	document.getElementById('thanks_form').innerHTML = '<span class="thanks_txt">Thank you for your enquiry. <br/> We will get in touch with you shortly.</span>';
	finTween = new OpacityTween(document.getElementById('enq_form'),Tween.cubicEaseOut, 0, 0, 0.2);
	finTween.start();
	
	var fini = new Object();
	
	
	fini.onMotionFinished = fadeOutFini;
		
	finTween.addListener(fini);
	
	
	
	
}


function fadeOutFini(){
	
	
	setTimeout("closeDrawer()", 3000);
}

function closeDrawer(){
	vs.slideOut();
	addListener_enq_bt();
	
	setTimeout("resetForm()", 1000);
	
}


function resetForm(){
	
	document.getElementById('thanks_form').innerHTML = '';
	finTween = new OpacityTween(document.getElementById('enq_form'),Tween.cubicEaseOut, 0, 100, 0.1);
	finTween.start();
	
	document.getElementById('Name').value = '';
	document.getElementById('Tel').value  = '';
	document.getElementById('Address').value  = '';
	document.getElementById('Email').value  = '';
	document.getElementById('Enquiry').value  = '';



	
}

//===============================================================================










function isValidEmail(strEmail){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;

   // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1) 
   {
      return false;
    } 
    return true; 
}







function checkme() {
	
	
	
	
	missinginfo = "";

	
	
	if (!document.form.accept_the_term.checked) {
		
		missinginfo = "You must agree to the terms";
		
	} 	else if(isValidEmail(document.form.youremail.value) == false){

			missinginfo = "Invalid Email";

		}










	if (missinginfo != "") {

		alert(missinginfo);
		return false;
	}
	else { 
		return true;
	}
}




(function($) {
    $.fn.ClearTypeFadeTo = function(options) {
        if (options)
                $(this)
                        .show()
                        .each(function() {
                                if (jQuery.browser.msie) {
                                        // Save the original background color
                                        $(this).attr('oBgColor', $(this).css('background-color'));
                                        // Set the bgColor so that bold text renders correctly (bug with IE/ClearType/bold text)
                                        $(this).css({ 'background-color': (options.bgColor ? options.bgColor : '#000') })
                                }
                        })
                        .fadeTo(options.speed, options.opacity, function() {
                                if (jQuery.browser.msie) {
                                        // ClearType can only be turned back on if this is a full fade in or
                                        // fade out. Partial opacity will still have the problem because the
                                        // filter style must remain. So, in the latter case, we will leave the
                                        // background color and 'filter' style in place.
                                        if (options.opacity == 0 || options.opacity == 1) {
                                                // Reset the background color if we saved it previously
                                                $(this).css({ 'background-color': $(this).attr('oBgColor') }).removeAttr('oBgColor');
                                                // Remove the 'filter' style to restore ClearType functionality.
                                                $(this).get(0).style.removeAttribute('filter');
                                        }
                                }
                                if (options.callback != undefined) options.callback();
                        });
    };

    $.fn.ClearTypeFadeIn = function(options) {
        if (options)
                $(this)
                        .css({ opacity: 0 })
                        .ClearTypeFadeTo({ speed: options.speed, opacity: 1, callback: options.callback });
    };

    $.fn.ClearTypeFadeOut = function(options) {
        if (options)
                $(this)
                        .css({ opacity: 1 })
                        .ClearTypeFadeTo({ speed: options.speed, opacity: 0, callback: options.callback });
    };
})(jQuery);
