function checkDrop(id) {
	if(confirm(convertHardCode('&#1576;&#1575; &#1575;&#1606;&#1578;&#1582;&#1575;&#1576; &#1575;&#1740;&#1606; &#1711;&#1586;&#1740;&#1606;&#1607; &#1588;&#1582;&#1589; &#1605;&#1608;&#1585;&#1583; &#1606;&#1592;&#1585; &#1575;&#1586; &#1604;&#1740;&#1587;&#1578; &#1583;&#1608;&#1587;&#1578;&#1575;&#1606; &#1588;&#1605;&#1575; &#1608; &#1588;&#1605;&#1575; &#1575;&#1586; &#1604;&#1740;&#1587;&#1578; &#1583;&#1608;&#1587;&#1578;&#1575;&#1606; &#1608;&#1740; &#1581;&#1584;&#1601; &#1582;&#1608;&#1575;&#1607;&#1740;&#1583; &#1588;&#1583;. &#1570;&#1740;&#1575; &#1605;&#1575;&#1740;&#1604; &#1576;&#1607; &#1575;&#1583;&#1575;&#1605;&#1607; &#1593;&#1605;&#1604;&#1740;&#1575;&#1578; &#1607;&#1587;&#1578;&#1740;&#1583;&#1567;'))){
        window.location='do_friend.php?type=delete&id='+id;
	}
}
//---------------------------
function checkAccept(id) {
	if(confirm(convertHardCode('&#1570;&#1740;&#1575; &#1605;&#1575;&#1740;&#1604; &#1576;&#1607; &#1662;&#1584;&#1740;&#1585;&#1601;&#1578;&#1606; &#1583;&#1593;&#1608;&#1578; &#1588;&#1582;&#1589; &#1605;&#1608;&#1585;&#1583;&#1606;&#1592;&#1585; &#1607;&#1587;&#1578;&#1740;&#1583;&#1567;'))){
        window.location='do_friend.php?type=accept&id='+id;
	}
}
//---------------------------
function checkReject(id) {
	if(confirm(convertHardCode('&#1570;&#1740;&#1575; &#1605;&#1575;&#1740;&#1604; &#1576;&#1607; &#1585;&#1583; &#1583;&#1593;&#1608;&#1578; &#1588;&#1582;&#1589; &#1605;&#1608;&#1585;&#1583;&#1606;&#1592;&#1585; &#1607;&#1587;&#1578;&#1740;&#1583;&#1567;'))){
        window.location='do_friend.php?type=reject&id='+id;
	}
}
//---------------------------
function checkCreateEvent() {
	if(document.create_event.event.value == "" || document.create_event.event.value == null || isblank(document.create_event.event.value)){
        alert(convertHardCode('.&#1604;&#1591;&#1601;&#1575;&#1611; &#1588;&#1585;&#1581; &#1585;&#1608;&#1740;&#1583;&#1575;&#1583; &#1605;&#1608;&#1585;&#1583;&#1606;&#1592;&#1585; &#1582;&#1608;&#1583; &#1585;&#1575; &#1608;&#1575;&#1585;&#1583; &#1606;&#1605;&#1575;&#1740;&#1740;&#1583;'));
        return false;
	}
    document.create_event.act.value='submit';
    document.create_event.submit();
    return true;
}
//---------------------------
function checkCreateMessage() {
	if(document.create_message.message.value == "" || document.create_message.message.value == null || isblank(document.create_message.message.value)){
        alert(convertHardCode('.&#1604;&#1591;&#1601;&#1575;&#1611; &#1606;&#1592;&#1585; &#1582;&#1608;&#1583; &#1585;&#1575; &#1608;&#1575;&#1585;&#1583; &#1606;&#1605;&#1575;&#1740;&#1740;&#1583;'));
        return false;
	}
    document.create_message.act.value='submit';
    document.create_message.submit();
    return true;
}
//---------------------------
function checkCreatePost() {
	if(document.create_post.post.value == "" || document.create_post.post.value == null || isblank(document.create_post.post.value)){
        alert(convertHardCode('.&#1604;&#1591;&#1601;&#1575;&#1611; &#1605;&#1578;&#1606; &#1605;&#1608;&#1585;&#1583; &#1606;&#1592;&#1585; &#1582;&#1608;&#1583; &#1585;&#1575; &#1608;&#1575;&#1585;&#1583; &#1606;&#1605;&#1575;&#1740;&#1740;&#1583;'));
        return false;
	}
    document.create_post.submit();
    return true;
}
//---------------------------
function checkCreateLink() {
	if(document.create_link.persian.value == "" || document.create_link.persian.value == null || isblank(document.create_link.persian.value)){
        alert(convertHardCode('.&#1604;&#1591;&#1601;&#1575;&#1611; &#1576;&#1585;&#1575;&#1740; &#1604;&#1740;&#1606;&#1705; &#1605;&#1608;&#1585;&#1583; &#1606;&#1592;&#1585;&#1578;&#1575;&#1606;&#1548; &#1593;&#1606;&#1608;&#1575;&#1606; &#1601;&#1575;&#1585;&#1587;&#1740; &#1585;&#1575; &#1608;&#1575;&#1585;&#1583; &#1606;&#1605;&#1575;&#1740;&#1740;&#1583;'));
        return false;
	}
	if(document.create_link.sitelink.value == "" || document.create_link.sitelink.value == null || isblank(document.create_link.sitelink.value)){
        alert(convertHardCode('.&#1604;&#1591;&#1601;&#1575;&#1611; &#1604;&#1740;&#1606;&#1705; &#1605;&#1608;&#1585;&#1583; &#1606;&#1592;&#1585;&#1578;&#1575;&#1606; &#1585;&#1575; &#1608;&#1575;&#1585;&#1583; &#1606;&#1605;&#1575;&#1740;&#1740;&#1583;'));
        return false;
	}
    document.create_link.act.value='submit';
    document.create_link.submit();
    return true;
}
//---------------------------
function checkModifyLink() {
	if(document.modify_link.persian.value == "" || document.modify_link.persian.value == null || isblank(document.modify_link.persian.value)){
        alert(convertHardCode('.&#1604;&#1591;&#1601;&#1575;&#1611; &#1576;&#1585;&#1575;&#1740; &#1604;&#1740;&#1606;&#1705; &#1605;&#1608;&#1585;&#1583; &#1606;&#1592;&#1585;&#1578;&#1575;&#1606;&#1548; &#1593;&#1606;&#1608;&#1575;&#1606; &#1601;&#1575;&#1585;&#1587;&#1740; &#1585;&#1575; &#1608;&#1575;&#1585;&#1583; &#1606;&#1605;&#1575;&#1740;&#1740;&#1583;'));
        return false;
	}
	if(document.modify_link.sitelink.value == "" || document.modify_link.sitelink.value == null || isblank(document.modify_link.sitelink.value)){
        alert(convertHardCode('.&#1604;&#1591;&#1601;&#1575;&#1611; &#1604;&#1740;&#1606;&#1705; &#1605;&#1608;&#1585;&#1583; &#1606;&#1592;&#1585;&#1578;&#1575;&#1606; &#1585;&#1575; &#1608;&#1575;&#1585;&#1583; &#1606;&#1605;&#1575;&#1740;&#1740;&#1583;'));
        return false;
	}
    document.modify_link.act.value='submit';
    document.modify_link.submit();
    return true;
}
//---------------------------
function checkDelete(type,id) {
	if (!type || !id) return false;
	else if(confirm(convertHardCode('&#1576;&#1575; &#1575;&#1606;&#1578;&#1582;&#1575;&#1576; &#1575;&#1740;&#1606; &#1711;&#1586;&#1740;&#1606;&#1607; &#1548; &#1575;&#1740;&#1606; &#1605;&#1608;&#1585;&#1583; &#1575;&#1586; &#1587;&#1740;&#1587;&#1578;&#1605; &#1581;&#1584;&#1601; &#1582;&#1608;&#1575;&#1607;&#1583; &#1588;&#1583;.&#1570;&#1740;&#1575; &#1605;&#1575;&#1740;&#1604; &#1576;&#1607; &#1575;&#1583;&#1575;&#1605;&#1607; &#1593;&#1605;&#1604;&#1740;&#1575;&#1578; &#1605;&#1740;&#8204;&#1576;&#1575;&#1588;&#1740;&#1583;&#1567;'))){
		window.location='do_delete.php?type='+type+'&id='+id;
	}
}
//---------------------------
function ch(str) {
	document.search_form.act.value="change";		
	if (str=='city') {
	    if (document.search_form.city.value==0) {
	          document.search_form.flag.value=str;			  
	          document.search_form.submit();
	    }
	} else {
        document.search_form.flag.value=str;
	    document.search_form.submit();
	}
}
//---------------------------
function doSearch() {
	if ((document.search_form.profile_name.value == "" || document.search_form.profile_name.value == null || isblank(document.search_form.profile_name.value)) && (document.search_form.profile_keywords.value == "" || document.search_form.profile_keywords.value == null || isblank(document.search_form.profile_keywords.value))) {
        alert(convertHardCode(".&#1604;&#1591;&#1601;&#1575; &#1576;&#1585;&#1575;&#1609; &#1580;&#1587;&#1578;&#1580;&#1608; &#1581;&#1583;&#1575;&#1602;&#1604; &#1610;&#1705; &#1605;&#1608;&#1585;&#1583; &#1585;&#1575; &#1608;&#1575;&#1585;&#1583; &#1606;&#1605;&#1575;&#1610;&#1610;&#1583;"));
        return false;
	}
	
	document.search_form.act.value="submit";		
	document.search_form.submit();
}
//---------------------------
function showImage(url , width , height) {
	var image_win=window.open(url ,"ShowImage" ,"width="+width+",height="+height+",status=0,resizable=0");
	image_win.focus();		
}
//---------------------------
function setAct(str) {
	document.groups_form.act.value=str;
    document.groups_form.submit();	
}
//---------------------------
function showImage(url , width , height) {
	var image_win=window.open(url ,"ShowImage" ,"width="+width+",height="+height+",status=0,resizable=0");
	image_win.focus();		
}
//---------------------------
function changeStatus(type,id) {
	if (!type || !id) return false;
	else window.location='do_status.php?type='+type+'&id='+id;
}
//---------------------------
function getAttachHTML(i) {
	var result='';
	var temp='';

	result+='<table cellpadding="0" cellspacing="0" width="100%">';

	if (i==1) result+='<tr><td height="1" class="PanelSep" colspan="7"></td></tr>';	
	result+='<tr>';
	result+='';
	result+='<td width="5" nowrap class="PanelRight"></td><td class="PanelRight" width="70" nowrap></td>';
	result+='<td width="5" nowrap class="Panelcenter"></td><td width="100%" class="Panelcenter"></td><td height="5" width="5" nowrap class="Panelcenter"></td>';
	result+='';
	result+='</tr>';
	result+='<tr>';
	result+='';
	result+='<td width="5" nowrap class="PanelRight"></td><td class="PanelRight" width="70" nowrap>&#1601;&#1575;&#1740;&#1604; &#1575;&#1604;&#1581;&#1575;&#1602;&#1740; '+i+'</td>';
	result+='<td width="5" nowrap class="Panelcenter"></td><td width="100%" class="Panelcenter"><input type="file" class="TextBox" name="attachment'+i+'"></td><td width="5" nowrap class="Panelcenter"></td>';
	result+='';
	result+='</tr>';
	result+='<tr>';
	result+='';
	result+='<td width="5" nowrap class="PanelRight"></td><td class="PanelRight" width="70" nowrap></td>';
	result+='<td width="5" nowrap class="Panelcenter"></td><td width="100%" class="Panelcenter"></td><td height="5" width="5" nowrap class="Panelcenter"></td>';
	result+='';
	result+='</tr>';
	result+='<tr><td height="1" class="PanelSep" colspan="7"></td></tr>';

	result+='</table>';	

	return result;
}
//---------------------------
function renderAttach() {
	var lastnum=document.getElementById("last_attach_number").value;
	var i=parseInt(lastnum)+1;
	var result=getAttachHTML(i);	
	document.getElementById("attach_elements").innerHTML+=result;
	document.getElementById("last_attach_number").value=i;
}
//---------------------------
var toggle=false;
function CheckAll(){
	toggle=!toggle;
	var c=0;
	var ml = document.favors;
	var len = ml.elements.length;
	for (var i = 0; i < len; i++) {
		var e = ml.elements[i];
		if (e.name.substring(0,3) == "chk") {
			e.checked=toggle;	
		}
	}
}
//---------------------------
function CheckShare(){
	EnterVar=convertHardCode('&#1576;&#1575; &#1575;&#1606;&#1578;&#1582;&#1575;&#1576; &#1575;&#1740;&#1606; &#1711;&#1586;&#1740;&#1606;&#1607; &#1548;  &#1605;&#1608;&#1590;&#1608;&#1593;(&#1607;&#1575;&#1740;) &#1575;&#1606;&#1578;&#1582;&#1575;&#1576;&#1740; &#1575;&#1586; &#1593;&#1604;&#1575;&#1602;&#1607;&#8204;&#1605;&#1606;&#1583;&#1740;&#8204;&#1607;&#1575;&#1740;&#8204;&#1578;&#1575;&#1606; &#1576;&#1607; &#1575;&#1588;&#1578;&#1585;&#1575;&#1705; &#1711;&#1584;&#1575;&#1588;&#1578;&#1607; &#1582;&#1608;&#1575;&#1607;&#1583; &#1588;&#1583;. &#1570;&#1740;&#1575; &#1605;&#1575;&#1740;&#1604; &#1576;&#1607; &#1575;&#1583;&#1575;&#1605;&#1607; &#1593;&#1605;&#1604;&#1740;&#1575;&#1578; &#1605;&#1740;&#8204;&#1576;&#1575;&#1588;&#1740;&#1583;&#1567;');
	if (confirm(EnterVar)) {
		document.favors.act.value='submit';
		document.favors.submit()
	}
}
//---------------------------
function ShowHidePanel(id){
	if(id)	{
		// changing dispaly of child nodes.
		if(document.getElementById(id))		{
			if(document.getElementById(id).style.display==""){
				document.getElementById(id).style.display="none";
			}
			else{
				document.getElementById(id).style.display="";
			}
		}
		// changing bullet to collapse or expand state.
		if(document.getElementById("img_"+id)){
			if(document.getElementById("img_"+id).src.indexOf("rectminus.gif")!=-1)
				document.getElementById("img_"+id).src="/images/profiles/rectplus.gif";
			else
				document.getElementById("img_"+id).src="/images/profiles/rectminus.gif";
		}
	}
}
//----------------------------------------
function mClk(src) {
  if (event.srcElement.tagName=='TD') { 
     src.children.tags('A')[0].click();
    }
}
//----------------------------------------
function getMultipleLabels(ob){
	arSelected=new Array();
    while (ob.selectedIndex!= -1) {
        if (ob.selectedIndex != 0){ 
			 arSelected.push(ob.options[ob.selectedIndex].text);
		}
		ob.options[ob.selectedIndex].selected = false;
    }
	document.getElementById("labels").value=arSelected.toString();
}


