// JavaScript Document
// check all function
$(document).ready(function(){
	$("#check-all").click(function() {
		var checked_status = this.checked;
		$(".mycheck").each(function(){
			this.checked = checked_status;
		});
	});
	// tipsy
	// nw | n | ne | w | e | sw | s | se
	$('.tool-tip-form[title]').tipsy({trigger: 'focus', gravity: 'w'});
	$('.tool-tip-nw').tipsy({gravity: 'nw',html: true});
	$('.tool-tip-n').tipsy({gravity: 'n',html: true});
	$('.tool-tip-ne').tipsy({gravity: 'ne',html: true});
	$('.tool-tip-w').tipsy({gravity: 'w',html: true});
	$('.tool-tip-e').tipsy({gravity: 'e',html: true});
	$('.tool-tip-sw').tipsy({gravity: 'sw',html: true});
	$('.tool-tip-s').tipsy({gravity: 's',html: true});
	$('.tool-tip-se').tipsy({gravity: 'se',html: true});
	//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-se').tipsy({gravity: 'se',html: true,fade: true});
	// tipsy
	//jqEasyCounter
	$('.count-input').jqEasyCounter({
		'maxChars': 255,
		'maxCharsWarning': 230
	});
});
	
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 ;
}

