 /////////////////////////shenime
 ////funksionet e meposhtme kerkojne patjeter te inkluduar klasen ne filin window.js
 /// per me shume rreth klases shiko tek http://prototype-window.xilinus.com/
 //////////////////////////////////////
 function ComfirmDialog(text,title, yesFunction, noFunction, yesLabel, noLabel, width, height, showicon, showprogress) {

    if ((width == null) || (width == 0))
        width=235;
    if ((height == null) || (height == 0))
        height=85;
    if (yesLabel == null)
        yesLabel = " Yes ";
    if (noLabel == null)
        noLabel = " No ";
    if (showicon == null)
        showicon = "true";
    if (showprogress == null)
        showprogress = "false";
    if (title == null)
        title = "Confirm";
	Dialog.confirm(text,
					{windowParameters: {title:title, width:width, height:height,showIcon:showicon,showProgress:showprogress}, okLabel: "  "+yesLabel+"  ", cancelLabel: "  "+noLabel+"  ",
						onCancel:function(win) {
								if (noFunction != null)
								{
									if (!noFunction.length)
										noFunction();
									else
										eval(noFunction)
								}
								//Dialog.closeInfo();
						},
						onOk:function(win) {

						       if (yesFunction != null)
						        {
						            if (!yesFunction.length)
						            	yesFunction();
						            else
						            {
										eval(yesFunction)
									}
        						}
        						//Dialog.closeInfo();
        						return true;
						}}
						);
 }
 function AlertDialog(text, title, okFunction, okLabel, width, height, iconType, showicon, showprogress) {
    
    if ((width == null) || (width == 0))        var width=235;
    if ((height == null) || (height == 0))      var height=85;
    
    if (okLabel == null)				var okLabel=" Ok ";
    if (showicon == null)				var showicon = "true";
    if (showprogress == null)			var showprogress = "false";
    if (title == null)					var title = "Alert";
    if (iconType == null)				var iconType = "iconAlert";

	 Dialog.alert(text,
				 {windowParameters: {title:title, width:width, height:height,showIcon:showicon,showProgress:showprogress,iconType:iconType}, okLabel: "  "+okLabel+"  ",
				  onOk:function(win) {
					   if (okFunction != null)
						{
							if (!okFunction.length)
								okFunction();
							else
								eval(okFunction)
						}
						return true;
					}}
					);

 }

 function InfoDialog(text, title, width, height, showicon, showprogress,timeout,splash) {
    if ((width == null) || (width == 0))
        var width=235;
    if ((height == null) || (height == 0))
        var height=45;
    if (showicon == null)
        var showicon = "true";
    if (showprogress == null)
        var showprogress = "false";
	
	if (splash!=null && splash==1)
		height = height+40;
	else
		var splash = 0;
	 Dialog.info(text,
				 {title:title, width:width, height:height,showIcon:showicon,showProgress:showprogress,showSplash:splash});

	if(timeout != null)
		setTimeout(closeDialog, (timeout*1000))
 }
 function loaderDialog(title, width, height, id, splash)
 {
    if ((width == null) || (width == 0))
        var width=235;
    if ((height == null) || (height == 0))
        var height=45;
	if (title == null)
		var title = "Loading, please wait...";
	if (id == null)
		var idtype = "generated";
	else
	{
		var idtype = id;
		closeDialog(id)
	}
	if (splash!=null && splash==1)
		height = height+40;
	else
		var splash = 0;
	//alert(otherprop+moreprop)
	//Dialog.info("",{title:title, width:width, height:height,showProgress:true,id:idtype,destroyOnClose:true,showSplash:splash});
    if (splash)
      	var content_s = "<div id='modal_dialog_splash' class='alert_splash'>  </div>";
    else
      	var content_s ="";
    var content = content_s+"<div id='modal_dialog_message' class='alert_message'></div>";
        content += "<div id='modal_dialog_progress' class='alert_progress'>  </div>";
	var winLoading = new Window(idtype,{className: "alert", title: title,draggable:false,closable:false,
						  width:width, height:height})
	
	winLoading.setHTMLContent(content)
	winLoading.showCenter(false);					  
 }
 function closeDialog(id)
 {
 	if(id==null)
 	{
 		Windows.getWindow('generated').close();
 		Windows.getWindow('generated').destroy();
 	}
 	else
 	{
 		if(Windows.getWindow(id))
 		{
 			Windows.getWindow(id).close();
 			Windows.getWindow(id).destroy();
 		}
 	}
 	//Dialog.closeInfo();
 } 
 function closeDialogs(id,timeout)
 {
 	//alert("insideclose-"+id);
	if(timeout != null)
		setTimeout("closeDialog(id)", (timeout*1000))
	else
		closeDialog(id)
 } 
