function startloader(id){
	id=1;
	w=$(window).width() / 2;
	h=getScrollY() + 150;
	img = '/images/ajax-animation/loader'+id+'.gif';
	var my_html = '<div style="display:none;z-index:99;position:absolute;top:'+h+'px;left:'+w+'px;" id="lader"><img src="' + img + '"></div>';
	$("body").prepend(my_html);
	$("#lader").show();
}

function stoploader(){
	$('#lader').remove();
}

function open_popdiv(msg, color, nonhide){
	var out = '';
	params = 'position:absolute;display:none;z-index:99;font-size:14px;left:' + ($(window).width() / 2 - 100) + 'px;top:' + (getScrollY() + 150) + 'px;'
	switch(color){
		case 'red':
		out+='<div id="popdiv" style="width:277px;height:77px;background:#fff; border:2px solid #ff0000;padding:0px;cursor:pointer;'+params+'" onClick="close_popdiv()">';
			out+='<div style="width:207px; height:57px; margin: 10px 10px 10px 60px;">';
				out+=msg;
			out+='</div>';
		out+='</div>';
		break;
		
		case 'green':
		out+='<div id="popdiv" style="width:270px;height:77px;background:#fff; border:2px solid #00BB00;padding:0px;cursor:pointer;'+params+'" onClick="close_popdiv()">';
			out+='<div style="width:200px; height:57px; margin: 10px 10px 10px 60px;">';
				out+=msg;
			out+='</div>';
		out+='</div>';
		break;
		
		default: return ; break;
	}
	if($("#popdiv").length != 0){
		close_popdiv();
	}
	$("body").prepend(out);
	$("#popdiv").show();
	$("#popdiv").focus();
	if(nonhide==undefined){
		setTimeout('close_popdiv()', 2000);
	}
}
function close_popdiv(){
	$("#popdiv").remove();
}


function getScrollY() 
{
    scrollY = 0;    
    if (typeof window.pageYOffset == "number") {
        scrollY = window.pageYOffset;
    } else if (document.documentElement && document.documentElement.scrollTop) {
        scrollY = document.documentElement.scrollTop;
    }  else if (document.body && document.body.scrollTop) {
        scrollY = document.body.scrollTop; 
    } else if (window.scrollY) {
        scrollY = window.scrollY;
    }
    return scrollY;
}
