function makeRemotet(url){
	remote = window.open(url,"remotewin","width=400,height=100,scrollbars=1");
	remote.location.href = url;
	if (remote.opener == null) remote.opener = window;
}

function jumpPage(form) {
   i = form.forum.selectedIndex;
   if (i == 0) return;
   window.location.href = url[i+1];
}

function openWindow(url) {
   opinion = window.open(url,"Handheld",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=150,height=400');
}

function makeRemoteE(url){
	remote = window.open(url,"remotewin","width=520,height=500,scrollbars=1");
	remote.location.href = url;
	if (remote.opener == null) remote.opener = window;
}

function makeRemote(url){
	remote = window.open(url,"remotewin","width=520,height=500,scrollbars=1");
	remote.location.href = url;
	if (remote.opener == null) remote.opener = window;
}
function makeRemoteb(url){
	remote = window.open(url,"remotewin","width=800,height=500,scrollbars=1");
	remote.location.href = url;
	if (remote.opener == null) remote.opener = window;
}
function makeRemote2(url){
	remote = window.open(url,"remotewin","width=520,height=600,scrollbars=1");
	remote.location.href = url;
	if (remote.opener == null) remote.opener = window;
}
function mishal(url){
	remote = window.open(url,"remotewin","width=550,height=680,scrollbars=1");
	remote.location.href = url;
	if (remote.opener == null) remote.opener = window;
}

function checkit(val) {
   dlink=document.links;
   len = dlink.elements.length;
   var i=0;
   for( i=0 ; i<len ; i++) {
      if (dlink.elements[i].name=='selected') {
         dlink.elements[i].checked=val;
      }
   }
}

function checkitpro(val) {
   dlink=document.links;
   len = dlink.elements.length;
   var i=0;
   for( i=0 ; i<len ; i++) {
      if (dlink.elements[i].name=='user_selected') {
         dlink.elements[i].checked=val;
      }
   }
}

function check_cookie(cookie_name) {
   var cookies = document.cookie;
   var pos = cookies.indexOf(cookie_name,'=');
   if (pos != -1) {
      return true;
   }
   else {
      return false;
   }
}

function smilie_remote(emotionicon) {
   self.opener.document.post_form.body.value += emotionicon+" ";
   self.opener.document.post_form.body.focus();
}

function smilie(emotionicon) {
   document.post_form.body.value += emotionicon+" ";
   document.post_form.body.focus();
}

function choose_avatar(avatar) {
   self.opener.document.user.pc.value = avatar;
}

function SwitchPD(){
	if (document.body.dir == "rtl") {
		document.body.dir = "ltr";
	}
	else {
		document.body.dir = "rtl";
	}
}



function convText(origStr,str)
{
	str = str.toLowerCase();
	if (str == "code" || str == "quote" || str == "re" || str.indexOf("link:") != -1)
		origStr = origStr.replace(/\&l;/ig,"[").replace(/\&r;/ig,"]");
	return origStr;
}

function codeThat(obj)
{
	str = obj.value;
	str = str.replace(/\[/g,"&l;");
	str = str.replace(/\]/g,"&r;");
	str = str.replace(/\&l;(.*?)\&r;/ig,function (a,b) {return convText(a,b)});
	str = str.replace(/\&l;\/(.*?)\&r;/ig,function (a,b) {return convText(a,b)});
	obj.value = str;
}


function maaser(url){
	remote = window.open(url,"remotewin","width=600,height=280,scrollbars=1");
	remote.location.href = url;
	if (remote.opener == null) remote.opener = window;
}

function updatePropertyDisplay(ommObj) {  

  document.post_form.omm.value=ommObj  
  document.post_form.subject.focus();
}

function correctPNG()
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}
window.attachEvent("onload", correctPNG);
