
$(document).ready(function() {

	hs.lang = {
		creditsText : '',
		creditsTitle : ''
	},
	
	hs.graphicsDir = '/images/hs/';
	hs.align = "center";
	hs.dimmingOpacity = 0.50;	
	hs.outlineType = 'rounded-white';
	hs.wrapperClassName = 'draggable-header';		
});

// header all condition menu
/////////////////////////////////////////////////////////////////
// 	the following code block is for All condition right side menu

function menu_slide_up()
{
	TimerRunning = false;
	$("#push_page_div").slideUp("fast");	
	$("#ajax_menu").slideUp("fast");
	$('#dropmenuatag').removeClass('dropmenuactive');

}
var TimerRunning = false;

$(document).ready(function(){
	
	var timer ;
 	$("#ajax_menu").mouseleave(function(){
		 TimerRunning=true;
		timer=	setTimeout ( "menu_slide_up()", 50);
	}); 
	$("#cat_menu").mouseleave(function(){
		TimerRunning=true;
	 	timer = setTimeout ( "menu_slide_up()", 50);
		$("#ajax_menu").stop(true,true);
	}); 
	$("#ajax_menu").mouseenter(function(){
		clearTimeout(timer);
		TimerRunning=false;
	});
	$("#cat_menu").mouseenter(function(){ 
		
		var myleft =  $(this).offset().left;
		//$("#ajax_menu").css("left",myleft-800);	
		
		
		if(TimerRunning == true)
		{
			clearTimeout(timer);
			TimerRunning=false;
		}
		else
		{
			
			$('#dropmenuatag').addClass('dropmenuactive');
			$("#ajax_menu").slideDown("slow");
			$("#push_page_div").slideDown("fast");	
		}
	});
	
	
	
});
// 	End of code block 
//////////////////////



function validateEmail(email)
{
    if(email.length <= 0)
	{
	  return true;
	}
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    {
      var regexp_user=/^\"?[\w-_\.]*\"?$/;
      if(splitted[1].match(regexp_user) == null) return false;
    }
    if(splitted[2] != null)
    {
      var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
      if(splitted[2].match(regexp_domain) == null) 
      {
	    var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
	    if(splitted[2].match(regexp_ip) == null) return false;
      }// if
      return true;
    }
return false;
}



function ShowForgotPasswordBox()
{
	forgot = document.getElementById('forgotpass');
	
	if(forgot.style.display == 'none')
		forgot.style.display = 'block';
	else
		forgot.style.display = 'none';
		
}
function htmlData(url,qstring,div)
{
	if (url.length==0)
	{
		document.getElementById(div).innerHTML="";
		return;
	}
	
	$.ajax({
		url: url,
		data:'',
		success: function(data) {
		document.getElementById(div).innerHTML=data;
		}
	});
	
}

function preloadImages()

{

  if(document.images)

  {

    if(!document.imageArray) document.imageArray = new Array();

    var i,j = document.imageArray.length, args = preloadImages.arguments;

    

    for(i=0; i<args.length; i++)

    {

      if (args[i].indexOf("#")!=0)

      {

        document.imageArray[j] = new Image;

        document.imageArray[j++].src = args[i];

      }

    }

  }

}

preloadImages('/images/loader.gif');

(function($){ 		  
	$.fn.popupWindow = function(instanceSettings){
		
		return this.each(function(){
		
		$(this).click(function(){
		
		$.fn.popupWindow.defaultSettings = {
			centerBrowser:0, // center window over browser window? {1 (YES) or 0 (NO)}. overrides top and left
			centerScreen:0, // center window over entire screen? {1 (YES) or 0 (NO)}. overrides top and left
			height:500, // sets the height in pixels of the window.
			left:0, // left position when the window appears.
			location:0, // determines whether the address bar is displayed {1 (YES) or 0 (NO)}.
			menubar:0, // determines whether the menu bar is displayed {1 (YES) or 0 (NO)}.
			resizable:0, // whether the window can be resized {1 (YES) or 0 (NO)}. Can also be overloaded using resizable.
			scrollbars:0, // determines whether scrollbars appear on the window {1 (YES) or 0 (NO)}.
			status:0, // whether a status line appears at the bottom of the window {1 (YES) or 0 (NO)}.
			width:500, // sets the width in pixels of the window.
			windowName:null, // name of window set from the name attribute of the element that invokes the click
			windowURL:null, // url used for the popup
			top:0, // top position when the window appears.
			toolbar:0 // determines whether a toolbar (includes the forward and back buttons) is displayed {1 (YES) or 0 (NO)}.
		};
		
		settings = $.extend({}, $.fn.popupWindow.defaultSettings, instanceSettings || {});
		
		var windowFeatures =    'height=' + settings.height +
								',width=' + settings.width +
								',toolbar=' + settings.toolbar +
								',scrollbars=' + settings.scrollbars +
								',status=' + settings.status + 
								',resizable=' + settings.resizable +
								',location=' + settings.location +
								',menuBar=' + settings.menubar;

				settings.windowName = this.name || settings.windowName;
				settings.windowURL = this.href || settings.windowURL;
				var centeredY,centeredX;
			
				if(settings.centerBrowser){
						
					if ($.browser.msie) {//hacked together for IE browsers
						centeredY = (window.screenTop - 120) + ((((document.documentElement.clientHeight + 120)/2) - (settings.height/2)));
						centeredX = window.screenLeft + ((((document.body.offsetWidth + 20)/2) - (settings.width/2)));
					}else{
						centeredY = window.screenY + (((window.outerHeight/2) - (settings.height/2)));
						centeredX = window.screenX + (((window.outerWidth/2) - (settings.width/2)));
					}
					window.open(settings.windowURL, settings.windowName, windowFeatures+',left=' + centeredX +',top=' + centeredY).focus();
				}else if(settings.centerScreen){
					centeredY = (screen.height - settings.height)/2;
					centeredX = (screen.width - settings.width)/2;
					window.open(settings.windowURL, settings.windowName, windowFeatures+',left=' + centeredX +',top=' + centeredY).focus();
				}else{
					window.open(settings.windowURL, settings.windowName, windowFeatures+',left=' + settings.left +',top=' + settings.top).focus();	
				}
				return false;
			});
			
		});	
	};
})(jQuery);

