// preload site images
function imagePreLoader() 
{
     var i = 0;
     imageObj = new Image();
     images = new Array();

     images[0] = "http://www.shtoza.com/images/general/app_store_btn.gif";
     images[1] = "http://www.shtoza.com/images/general/app_store_btn_over.gif";
     images[2] = "http://www.shtoza.com/images/general/app_store_btn_reflection.gif";
     images[3] = "http://www.shtoza.com/images/general/app_store_btn_reflection_over.gif";
     images[4] = "http://www.shtoza.com/images/general/iphone_frame_horizontal.png";
     images[5] = "http://www.shtoza.com/images/general/main_img.jpg";
     images[6] = "http://www.shtoza.com/images/orange/tab_left_over.gif";
     images[7] = "http://www.shtoza.com/images/orange/tab_center_over.gif";
     images[8] = "http://www.shtoza.com/images/orange/tab_right_over.gif";
     images[9] = "http://www.shtoza.com/images/orange/tod/1.jpg";
     images[10] = "http://www.shtoza.com/images/orange/tod/2.jpg";
     images[11] = "http://www.shtoza.com/images/orange/tod/3.jpg";
     images[12] = "http://www.shtoza.com/images/orange/tod/4.jpg";
     images[13] = "http://www.shtoza.com/images/orange/tod/5.jpg";

     // start preloading     
	 for(i = 0; i <= 13; i++) {
		imageObj.src = images[i];     
	}
}

// Check if email is valid
function IsEmailValid(obj) {
	var emailId = obj.value;
	var apos=emailId.indexOf("@");
	var dotpos=emailId.lastIndexOf(".");
	var lastpos=emailId.length-1;

	if (emailId.indexOf(' ')==-1 && 0 < emailId.indexOf('@') && 0 < emailId.indexOf('.') && emailId.indexOf('@')+1 < emailId.length && emailId.length >= 5)
	{
		return true;
	}
	return false;
}

// Check if string is blank
function isBlank(str) {
    for (var i = 0; i < str.length; i++) {
        var chr = str.charAt(i);
        if ((chr != ' ') && (chr != '\n') && (chr != '\t')&& (chr != '\r')&& (chr != '\r\n')) {
            return false;
        }
    }
    return true;
}