	
function refreshcapt(a){
	$("#captchaimg").attr('src',"index.php?act=captchaimg&id="+a+"&"+Math.random());
}

function flags(){$("#DivAjax").html("<img src='../smimages/flags/"+$("#inflag").val()+".gif' alt='' />")}
function gto(A){window.location=A}function popUp(A){props=window.open(A,"poppage","toolbars=0, scrollbars=1, location=0, statusbars=0, menubars=0, resizable=1, width=600, height=400, left = 300, top = 150");return false;}function pprint(){this.window.print();}
function confi(A){return confirm(A)}function changeact(C,B){var A=document.getElementById(C);A.action=B;A.submit()}
function changeactconf(C,B,D){if(!confirm(D)){return false}var A=document.getElementById(C);A.action=B;A.submit()}
function loadBar(){$("#ajbar").load("index.php?act=bar")}
function tipon(x){	$("#tipbox").slideDown("normal",function(){$("#tipbox").html("<div><b>"+x[0]+"</b><br /><span>"+x[1]+"</span></div>")});	}
function tipoff(){	$("#tipbox").slideUp("normal",function(){$("#tipbox").html("")});	}	
function checkpress(a,b,c,d,e){
	var errors=0;
	var msg  = "______________________________________________________\n\n"
	if(e != 1){if($("#press_piconoff").is(':checked'))	{if($("#press_pic").val() == ""){errors +=1;msg += a+"\n";}}}
	if($("#press_sec").val() == ""){errors +=1;msg += b+"\n";}
	if($("#press_title").val() == ""){errors +=1;msg += c+"\n";}
	if($("#press_press").val() == ""){errors +=1;msg += d+"\n";}
	msg  += "______________________________________________________\n\n"
	if(errors != 0){alert(msg);return false;}else{return true;}
}
function sendajaxform(fname,action,t,di,meth,da,count,divlayer,imglo){var m="";	var d="";$("#"+di).fadeOut("slow");	if(meth == "post"){m="POST";}else{m="GET";}
		var re = new RegExp('class="suc-msg-square"');
		for(x=0;x<count;x++){d=d+da[x]+"="+$('[name='+da[x]+']').val()+"&";}
		$(divlayer).html('&nbsp;&nbsp;<img src="'+imglo+'" alt="" />&nbsp;&nbsp;');
		
		$.ajax({
			type: m,
			url: ""+action+"",
			data: ""+d+"token="+t,
			success: function(result){
					$(divlayer).html(" ");
					$("#"+di).html(result);
					$("#"+di).fadeIn("slow");
					if(result.match(re))
						{
							for(x=0;x<count;x++){$("#"+da[x]).val("");}
						}
				}
			})
			
		return false; 
	}
	
function sendcomm(fname,action,t,di,meth,da,count,divlayer,imglo,id){var m="";	var d="";$("#"+di).fadeOut("slow");	if(meth == "post"){m="POST";}else{m="GET";}
		var re = new RegExp('class="suc-msg-square"');
		for(x=0;x<count;x++){d=d+da[x]+"="+$('[name='+da[x]+']').val()+"&";}
		$(divlayer).html('&nbsp;&nbsp;<img src="'+imglo+'" alt="" />&nbsp;&nbsp;');
		
		$.ajax({
			type: m,
			url: ""+action+"",
			data: ""+d+"token="+t,
			success: function(result){
					$(divlayer).html(" ");
					$("#"+di).html(result);
					$("#"+di).fadeIn("slow");
					if(result.match(re))
						{
							refreshcapt(id);
							for(x=0;x<count;x++){$("#"+da[x]).val("");}
						}
				}
			})
			
		return false; 
	}
	
function sendpollform(fname,action,t,di,meth,da,count,divlayer,imglo){var m="";	var d="";$("#"+di).fadeOut("slow");	if(meth == "post"){m="POST";}else{m="GET";}
		for(x=0;x<count;x++){d=d+da[x]+"="+$('[name='+da[x]+']').val()+"&";}
		$(divlayer).html('&nbsp;&nbsp;<img src="'+imglo+'" alt="" />&nbsp;&nbsp;');
		
		$.ajax({
			type: m,
			url: ""+action+"",
			data: ""+d+"token="+t,
			success: function(result){
					$(divlayer).html(" ");
					$("#"+di).html(result);
					$("#"+di).fadeIn("slow");
					for(x=0;x<count;x++){$("#"+da[x]).val("");}
				}
			})
			
		return false; 
	}
	
function poll(action,t,di,meth,da,confmsg,divlayer,imglo)
	{
		if(confirm(confmsg))
			{
				var m="";
				var d="";
				$("#"+di).fadeOut("slow");
				if(meth == "post"){m="POST";}else{m="GET";}
				d="opt="+$("#"+da).val()+"&";
				$(divlayer).html('&nbsp;&nbsp;<img src="'+imglo+'" alt="" />&nbsp;&nbsp;');
				$.ajax({
					type: m,
					url: ""+action+"",
					data: ""+d+"token="+t,
					success: function(result){
							$(divlayer).html(" ");
							$("#"+di).html(result);
							$("#"+di).fadeIn("slow");
							$("#m1").slideUp("normal");
							$("#m1").css("display","none");
							mstatus=0;
						}
					})
			}
			
		return false; 
	}
	
function ieFix() {

if(document.getElementById("vidse") != null){
	var ieFixElement = document.getElementById("vidse");
	ieFixElement.parentNode.removeNode(ieFixElement);
}

var ieFixElement2 = document.getElementById("autos");
ieFixElement2.parentNode.removeNode(ieFixElement2);
}

function jqueryst()
	{$(document).ready(function(){
			$(".tab-box").hover(function(){$(this).addClass("trcss");},function(){$(this).removeClass("trcss")});
			$("#checkall").click(function(){$("input:checkbox").attr("checked",true);$("tr").addClass("trcssch");$("#defaulttr").removeClass("trcssch")});$("#uncheckall").click(function(){$("input:checkbox").attr("checked",false);$("tr").removeClass("trcssch")});$(":checkbox").click(function(){if($(this).attr("checked")==true){$(this).parents("tr").addClass("trcssch")}else{$(this).parents("tr").removeClass("trcssch")}});
			$("#inflag").each(function(){$("#DivAjax").html("<img src='../smimages/flags/"+$("#inflag").val()+".gif' alt='' />")});
			$("textarea").focus(function(){$(this).addClass("input-focus");$(this).fadeTo('fast',0.5);$(this).fadeTo('fast',1.0)});
			$("textarea").blur(function(){$(this).removeClass("input-focus")});
			$("input.text").focus(function(){$(this).addClass("input-focus")});
			$("input.text").blur(function(){$(this).removeClass("input-focus")});
			$("input.rach").focus(function(){$(this).addClass("input-focus");$(this).fadeTo('fast',0.5);$(this).fadeTo('fast',1.0);});
			$("input.rach").blur(function(){$(this).removeClass("input-focus")});
			$("input.button").click(function(){$(this).addClass("buttondis");});
			$("#vidsdiv").load("index.php?act=vids");
		
		})
	};

	
function intwindow(winid,winclass,imgloader,auto_hide,positionid,url,img){
	$("#"+winclass).html('<div style="text-align: center"><img src="'+imgloader+'" alt="" /></div>');
	if(img == 1)
		{
			$("#"+winclass).html("<img src='"+url+"' alt='' />")
		}
	else
		{
			$("#"+winclass).load(""+url+"")
			
		}
			
	$("#"+winid).css("display","block");		
}

function close_window(winid,winclass){
	$("#"+winid).css("display","none");
	$("."+winclass).html("");
}

function leftdir(x){
	$(x).attr("direction","left");
}

function rightdir(x){
	$(x).attr("direction","right");
}
