function $$( Element ) { if ( document.getElementById( Element ) ) { return document.getElementById( Element ); } else { return false; } } function $$$( Element ) { if( document.getElementsByName( Element ) ) { var sasannobakht = document.getElementsByName( Element ); return sasannobakht[0]; } else { return false; } } function Hide( Element ) { if ( $$( Element ) ) { $( '#'+Element ).hide(); } } function Show( Element ) { if ( $$( Element ) ) { $( '#'+Element ).show(); } } function Change_Display( Element ) { if ( $$( Element ) ) { if ( $$( Element ).style.display == 'none' ) { Show( Element ); } else { Hide( Element ); } } } function Go_Url( Url , Time) { setTimeout('document.location.href="'+Url+'"',Time); } function Get_Value( Element ) { if( !$$( Element ) && !$$( Element+'1' ) ) { return 'No Object'; } else if( $$( Element ).type == 'checkbox' ) { return $$( Element ).checked; } else if( $$( Element ).type == 'radio' || $$( Element+'1' ).type == 'radio') { for( var i = 1; i <= Element.length; i++ ) { var nowid = ''+Element+''+i+''; if( $$(nowid).checked ) { return $$(nowid).value; } } return ''; } else { return $$( Element ).value; } } function Change_Title( Title ) { document.title = Title; } function Change_Class( Element , NewClass ) { if ( $$( Element ) ) { $( '#'+Element ).attr('class', NewClass); } } function Change_Opacity( Element , NewAlpha ) { if ( $$( Element ) ) { $( '#'+Element ).css("filter", "alpha(opacity="+NewAlpha+"%"); NewAlpha = NewAlpha/100; $( '#'+Element ).css("opacity", NewAlpha); } } function Change_Src( Element , NewSrc ) { if ( $$( Element ) ) { $( '#'+Element ).attr('src', NewSrc); } } function Element_Disable( Element ) { if ( $$( Element ) ) { $( '#'+Element ).attr('disabled', true); } } function Element_Enable( Element ) { if ( $$( Element ) ) { $( '#'+Element ).attr('disabled', ''); } } function Change_Disable( Element ) { if ( $$( Element ) ) { if ( $$( Element ).disabled ) { Element_Disable( Element ); } else { Element_Enable( Element ); } } } function Write( Element , Note ) { if ( $$( Element ) ) { Show( Element ); $( '#'+Element ).html(Note); //$$( Element ).innerHTML = Note; } } function GetScript(str) { let_out=str; str=str.split('#endofmyscript'); if(str[1] !=null) { DoEval(str[0]); let_out =let_out.replace(str[0]+'#endofmyscript', ''); } return let_out; } function FindScript(str) { let_out = str; jstr = let_out.split(''); if( newstr[1] != null ) { setTimeout("DoEval( newstr[0] )" , 1 ); } } return let_out; } function DoEval(js) { if(js!=null) { var sc = document.createElement('script'); jsCode = js; sc.type = 'text/javascript'; document.getElementsByTagName('head')[0].appendChild(sc); sc.text = 'try{eval(jsCode);}catch(e){}jsCode="";'; sc.text = "\/\/ Programmer : Sasan Nobakht :-)\n\/\/ Mobile : +989153128966 :D"; } } function Ajax( Metod , Page , Data , Result_Id , Loading , Type , LoadingPicture , LoadingText , Wait_Id , Javascript ) { Data = 'Programmer=Sasan Nobakht&Load=Ajax&'+Data+''; $.ajax({ type: Metod, url: Page, data: Data , encoding: 'UTF-8', async: true, beforeSend : function( msg ) { if ( Loading ) { Ajax_Loading( Metod , Page , Data , Result_Id , Loading , Type , LoadingPicture , LoadingText , Wait_Id , Javascript , true ) } }, success : function( msg ) { if ( Loading ) { Ajax_Loading( Metod , Page , Data , Result_Id , Loading , Type , LoadingPicture , LoadingText , Wait_Id , Javascript , false ) } if ( Type != 'NoResultShow' && Type != 'Input' ) { $('#'+Result_Id).show(); msg = GetScript(msg); $('#'+Result_Id).html(msg); } else if ( Type == 'Input' ) { msg = GetScript(msg); $$(Result_Id).value = msg; } if ( Javascript !== '' ) { var sasan_all_java = Javascript.split( ';' ); for ( i = 0; i < sasan_all_java.length; i++ ) { setTimeout("eval("+sasan_all_java[i]+")",100); } } }, error : function( msg ) { } }); } function Ajax_Loading( Metod , Page , Data , Result_Id , Loading , Type , LoadingPicture , LoadingText , Wait_Id , Javascript , Mode ) { if ( Mode ) { if (Type == 'Text') { Write(Wait_Id,LoadingText); } else if (Type == 'Picture') { Write(Wait_Id,'