<!--
$(document).ready(function() {
	// top nav
	$(".TopNav").hover(
	function() {
		$(this).removeClass("TopNav");
		$(this).addClass("TopNavOn");
	},
	function() {
		$(this).removeClass("TopNavOn");
		$(this).addClass("TopNav");
	});
	
	// promoter select
	$(".__selectpromoter").hover(
	function() {$(".__arrow").attr("src","../_images/icons/arrow_down_green.png");},
	function() {$(".__arrow").attr("src","../_images/icons/arrow_down_white.png");});
	
	// alpha effect
	$(".Alpha50").hover(
	function() {$(this).removeClass("Alpha50");},
	function() {$(this).addClass("Alpha50");});
	
	// remove error css
	$(".__required").focus(function() {
		 $(this).removeClass("BoxError");
	});
	
	// button roll over
	$(".BtnStd").hover(
	function() {
		$(this).removeClass("BtnStd");
		$(this).addClass("BtnStdOver");
	},
	function() {
		$(this).removeClass("BtnStdOver");
		$(this).addClass("BtnStd");
	});
	
	// button roll over
	$(".BtnSubmit").hover(
	function() {$(this).removeClass("BtnSubmit").addClass("BtnSubmitOver");},
	function() {$(this).removeClass("BtnSubmitOver").addClass("BtnSubmit").removeClass("BtnSubmitActive");});
	$(".BtnSubmit").click(function() {$(this).addClass("BtnSubmitActive");});
	
	// stripe a table
	$('.stripeMe tr:even').addClass("alt");
	$('.stripeMe tr').hover(function() {$(this).addClass("over");},function() {$(this).removeClass("over");});
			
	// hover effect
	$(".__hover").hover(function() {$(this).addClass("BoxHover");},function() {$(this).removeClass("BoxHover");});
	$(".__hover").focus(function() {$(this).addClass("BoxHover");});
	$(".__hover").blur(function() {$(this).removeClass("BoxHover");});
	
	// inner shadow effect
	$(".__innershadow").hover(
	function() {$(this).addClass("InnerShadow");},
	function() {$(this).removeClass("InnerShadow");});
});

// DIALOG BOX
function DialogBox(action,url,input,header,w,h,r,m) {
	if (action == "close") {
		$("#DialogBox").dialog("destroy");
	} else {
		$("#DialogBox").dialog("destroy");
		if (header != "") {$("#DialogBox").attr('title',header);}
		if (w != "") {w = parseFloat(w)} else {w = 'auto'}
		if (h != "") {h = parseFloat(h)} else {h = 'auto'}
		if (r != "") {r = r} else {r = false}
		if (m != "") {m = m} else {m = true}
		
		$("#DialogBox").dialog("open");
		$("#DialogBox").dialog({
			resizable: r,
			minWidth: 300,
			width: w,
			minHeight: 100,
			height: h,
			modal: m,
			overlay: {backgroundColor: '#000',opacity: 0.5}
		});
		
		// testing
		//$("#DialogBox").dialog("option","width",w);
		//$("#DialogBox").dialog("option","height",h);
		
		switch (url) {
			case "Success":
				input = "<div style='float: left; width: 40px; padding: 10px 0px;'><img src='../_images/icons/check_32.png' align='absmiddle'></div><div style='float: right; padding-top: 13px; width: 230px;'>" + input + "</div>";
				$("#DialogInfo").html(input);
				break;
			case "Error":
				input = "<div style='float: left; width: 40px; padding: 10px 0px;'><img src='../_images/icons/warning_32.png' align='absmiddle'></div><div style='float: right; padding-top: 13px; width: 230px;'>" + input + "</div>";
				$("#DialogInfo").html(input);
				break;
			case "Html":
				$("#DialogInfo").html(input);
				break;
			default :
				$.ajax({
					url: url+"?a="+input,
					cache: false,
					success: function(html){
						$("#DialogInfo").html(html);
					}
				});
				break;
		}
	}
}

// OVERLAY MSG BOX
function MsgBox(msgtype,header,msg,w,h) {
	var text = "";
	$("#DialogBox").dialog("destroy");
	$("#DialogBox").dialog("open");
	$("#DialogBox").attr('title',header);
	$("#DialogBox").dialog({
		resizable: false,
		minWidth: 300,
		width: w,
		minHeight: 100,
		height: h,
		modal: true,
		overlay: {backgroundColor: '#000',opacity: 0.5}
	});
	switch (msgtype) {
		case "ok":
			text = "<table width='100%'><tr><td style='width: 32px;' class='AccountText'><img src='../_images/icons/check_32.png'></td><td class='AccountText'>" + msg + "</td></tr></table>";
			break;
		case "err":
			text = "<table width='100%'><tr><td style='width: 32px;' class='AccountText'><img src='../_images/icons/warning_32.png'></td><td class='AccountText Red'>" + msg + "</td></tr></table>";
			break;
		case "msg":
			text = msg;
			break;
		case "anim":
			text = "<table width='100%'><tr><td style='width: 16px;' class='AccountText'><img src='../_images/preloaders/broken_circle_16.gif'></td><td class='AccountText'>" + msg + "</td></tr></table>";
			break;
	}
	$("#DialogInfo").html(text);
}

// load ajax content 
function AjaxThis(action,id) {
	$.ajax({ 
		url: action,
		cache: false, 
		success: function(html) {
			$(id).html(html);
		}
	});
}

// submit ajax form (serialized)
function AjaxThisForm(action,form_id,target_id) {
	$.ajax({
		type: "POST",
		url: action,
		data: $(form_id).serialize(),
		dataType: "html",
		success: function(html){
			//alert(html)
			$(target_id).html(html);
		}
	});
}

// load url
function loadUrl(url) {
	window.location=url;
}
//-->


