function openWindow(url,width,height){ 
    var x = parseInt((screen.width - width)/2);  
    var y = parseInt((screen.height - height)/2)-20; 
    var isMSIE= (navigator.appName == "Microsoft Internet Explorer");
    if (isMSIE) {           
         window.open(url, "", "width="+width+",height="+height+",left="+x+",top="+y+",status=no,directories=no,scrollbars=no,resizable=no"  ); 
     } else { 
        window.open(url, "", "top=" + y + ",left=" + x + ",scrollbars=no,dialog=no,modal=no,width=" + width + ",height=" + height + ",resizable=no" ); 
    } 
} 

function changeDisplay(div_id){
	var div_tag = document.getElementById(div_id);
	if ("none" == div_tag.style.display)
		div_tag.style.display = "";
	else
		div_tag.style.display = "none";
}

function showDiv(div_id){
	var div_tag = document.getElementById(div_id);
	div_tag.style.display = "block";
}

function hiddenDiv(div_id){
	var div_tag = document.getElementById(div_id);
	div_tag.style.display = "none";
}

function inlineDiv(div_id){
	var div_tag = document.getElementById(div_id);
	div_tag.style.display = "inline";
}

function showcateList(type){
	 
	 if($("#catelist"+type).css("display")=="none"){
		$(".category-list").css("display","none");
	    $("#catelist"+type).css("display","block");
	 }else{
		$("#catelist"+type).css("display","none");  
	 }
}
function selectCategory(cateId,type,val){
	if(type==1){
		$("#categoryId").val(cateId);
		$(".cateselected1").text(val);
	}else if(type==2){
		$("#categoryId2").val(cateId);
		$(".cateselected2").text(val);
	}
	
	$("li.selected",$("#catelist"+type)).removeClass("selected");
	$("li.cate_li_"+cateId,$("#catelist"+type)).addClass("selected");
	$(".category-list").css("display","none");
}
function validaImage(path){
   
   path=path.toUpperCase();
   
   if(path.lastIndexOf(".JPG")>0)
      return true;
   if(path.lastIndexOf(".JPEG")>0)
      return true;
   if(path.lastIndexOf(".GIF")>0)
      return true;
   if(path.lastIndexOf(".PNG")>0)
      return true;
     
   
    return false;
     
}
