// JavaScript Document
// check all function
$(document).ready(function(){
	$(window).scroll(function() {
		var win=$(document).height(); 
		var scrollBottom = $(window).scrollTop() + $(window).height();
		var scrollTop = $(window).scrollTop();
		var windowH = $(window).height();
		if ((scrollBottom>=(win-100)) && (scrollTop!=0)) {
			$('#powered-icon').slideDown();
		} else {
			$('#powered-icon').slideUp();
		}
	});
	// tipsy
	// nw | n | ne | w | e | sw | s | se
	$('.tool-tip-form[title]').tipsy({trigger: 'focus', gravity: 'w',html: true,opacity: 1});
	$('.tool-tip-form-s[title]').tipsy({trigger: 'focus', gravity: 's',html: true,opacity: 1});
	$('.tool-tip-nw').tipsy({gravity: 'nw',html: true,opacity: 1});
	$('.tool-tip-n').tipsy({gravity: 'n',html: true,opacity: 1});
	$('.tool-tip-ne').tipsy({gravity: 'ne',html: true,opacity: 1});
	$('.tool-tip-w').tipsy({gravity: 'w',html: true,opacity: 1});
	$('.tool-tip-e').tipsy({gravity: 'e',html: true,opacity: 1});
	$('.tool-tip-sw').tipsy({gravity: 'sw',html: true,opacity: 1});
	$('.tool-tip-s').tipsy({gravity: 's',html: true,opacity: 1});
	$('.tool-tip-se').tipsy({gravity: 'se',html: true,opacity: 1});
	//fade
	$('.tool-tip-nwf').tipsy({gravity: 'nw',html: true,fade: true});
	$('.tool-tip-nf').tipsy({gravity: 'n',html: true,fade: true});
	$('.tool-tip-nef').tipsy({gravity: 'ne',html: true,fade: true});
	$('.tool-tip-wf').tipsy({gravity: 'w',html: true,fade: true});
	$('.tool-tip-ef').tipsy({gravity: 'e',html: true,fade: true});
	$('.tool-tip-swf').tipsy({gravity: 'sw',html: true,fade: true});
	$('.tool-tip-sf').tipsy({gravity: 's',html: true,fade: true});
	$('.tool-tip-sef').tipsy({gravity: 'se',html: true,fade: true});
	// tipsy
	$('.nyroModal').nm();
	$(".lazyload").lazyload({ 
//		effect : "fadeIn",
		placeholder : "/images/grey.gif"
	 });
	//jQuery lazyload
	$('.dynamic_select').bind('change', function () {
		var url = $(this).val(); // get selected value
		if (url) { // require a URL
		  window.location = url; // redirect
		}
		return false;
	});
	$("#check-all").click(function() {
		var checked_status = this.checked;
		$(".mycheck").each(function(){
			this.checked = checked_status;
		});
	});
}); // $(document).ready(function(){
	
function popupCenter(url,name,windowWidth,windowHeight){    
	myleft=(screen.width)?(screen.width-windowWidth)/2:100;	
	mytop=(screen.height)?(screen.height-windowHeight)/2:100;	
	properties = "width="+windowWidth+",height="+windowHeight;
	properties +=",scrollbars=yes, top="+mytop+",left="+myleft;   
	window.open(url,name,properties);
}

function showMyDiv (it, box) {
  var vis = (box.checked) ? "block" : "none";
  document.getElementById(it).style.display = vis;
}
// confirm click
function confirm_entry(url,str) {
	input_box=confirm(str);
	if (input_box==true){ 
		// Output when OK is clicked
		window.location.href=url;
	} else {
		// Output when Cancel is clicked
	}
}
// confirm submit
function ConfirmSubmit(str) {
	var agree=confirm(str);
	if (agree)
		return true ;
	else
		return false ;
}

function goThere(){
	var list=document.forms[0].goURL;
	var URL=list.options[list.selectedIndex ].value;
		if (URL) {
			location=URL;
		}
}
