﻿function SetStar( val, srcSet, srcUnset)
 {
	var id = document.getElementById("m_hidStarsMask").value;
	
	clearstars(srcUnset);
	for(i=1; i<=val; i++)
	{
		var star_id=id+i;
		var im = document.getElementById(star_id)
		im.src=srcSet;
	}
 }
 
 function clearstars()
 {
	//var id = im.id.substring(0,im.id.length()-1);
	var id = document.getElementById("m_hidStarsMask").value;
	for(i=1; i<=5; i++)
	{	
		var star_id=id+i;
		var im = document.getElementById(star_id);
		im.src='/img/reiting_empty.gif';
	}
 }
 
function onEnterpress(e)
{
    var KeyPress  
    //if which property of event object is supported  
    if(e && e.which)
    {
        e = e
        //character code is contained in NN4's which property
        KeyPress = e.which 
    }else{
        e = event
        KeyPress = e.keyCode
    }
    //13 is the key code of enter key
    if(KeyPress == 13)
    {
//    debugger;
		var hid=document.getElementById("Head_ctrl1_m_imbSearch");
		var title = document.getElementById("search_recipe");
		if(hid != null)
			hid.disabled=true;

   		if(document.getElementById('m_recipeCard_Button1') != null)
   			document.getElementById('m_recipeCard_Button1').disabled=true;
		
		
		hid = document.getElementById("m_hidSearch");
		if(hid!=null && title != null)
			hid.value=title.value;
		
		hid=document.getElementById("m_recipeCard_m_btn_titleSearch");
		if(hid != null)
		{
			hid.click();
		}
		else
		{
			var s='rcp_search.aspx?simple=1';
			if(title != null)
				s = s + "&title="+title.value;
			window.location=s;
		}
        return false;
    }
    else
       return true;
}

function show_image_const(img_id)
{
   
    bigpic = new Image;
    bigpic.src = "/dbimage.aspx?id="+img_id;;
   	
	src = bigpic.src;
	w = 250;
	h = 270;
	
    w1 = window.open('',"big",'resizable=no,menubar=no,toolbar=no,status=no,scrollbars=no,width='+w+',height='+h);
    w1.document.write("<html><body topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0 marginheight=0 marginwidth=0>");
    w1.document.write("<img src=\""+src+"\" width=\""+w+"\" height=\""+h+"\">");
    w1.document.write("</html></body>");
	
	w1.focus();

}

function show_image(img_id)
{
    browserName = navigator.appName;
	browserVer = parseInt(navigator.appVersion);

	if (((browserName == "Netscape") && (browserVer >= 3)) || ((browserName == "Microsoft Internet Explorer") && (browserVer >= 4))) useImages = "1";
	else useImages = "0";

//	bigpic = new Array;


    bigpic = new Image;
    bigpic.src = "dbimage.aspx?id="+img_id;;
    debugger;
	
	src = bigpic.src;
	w = bigpic.width;
	h = bigpic.height;
	width = w;
    height = h;
    w1 = window.open('',"big",'resizable=no,menubar=no,toolbar=no,status=no,scrollbars=no,width='+w+',height='+h);
    w1.document.write("<html><body topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0 marginheight=0 marginwidth=0>");
    w1.document.write("<img src=\""+src+"\" width=\""+w+"\" height=\""+h+"\">");
    w1.document.write("</html></body>");
	if (useImages == "1")
	{
	w1.focus();
	}
}

 