
function load_page($temp)
{

window.location.href=$temp;


}

function load_page($temp)
{

window.location.href=$temp;


}

function load_page_new_window($temp)
{
window.open($temp);
}

function enable_activities_update(check_box)
{
with (check_box.form)
{
submit.disabled=false;
}

}

function test(temp0)
{
temp1=temp0.pictureFileName.value;

}


function enable_packages_update(check_box)
{
with (check_box.form)
{
submit.disabled=false;
}

}

function reload_change(query_string) {

var sel_box=document.select_form.type;
typo=sel_box.options[sel_box.selectedIndex].text

if (typo=="Text")
infoType=1;
if (typo=="Text & Picture")
 infoType=2;
if (typo=="Picture")
infoType=3;
if (typo=="Bulleted or Numbered List")
infoType=4;
page_link="info_unit.php?" + query_string + "&infoType=" + infoType;
window.location.href=page_link;
}

function selective_direct(butt,page_add,query_string,new_win)
{
temp_var=page_add+"?"+query_string;
with (butt.form)
{
selection_made=0;

if (group1.length>0)
{
	for (x=0;x<group1.length;x++)
	{
		if (group1[x].checked) 
		{ 
		selection_made=1;
		break;
		}
	}
}
else
	{
	
	if (group1.checked)	
	{selection_made=1;}
	}

if (selection_made)
{
if (group1.length>0)
{temp_addon=group1[x].value}
else
{temp_addon=group1.value;}
$temp_url=page_add+"?"+query_string+temp_addon;
action=$temp_url;
}
else
{
window.alert("Select one of the radio buttons first");
action='';
return;
}
}

if (selection_made)
{

if (new_win>=1)
{
butt.form.action='';
window.open($temp_url);
return;
}
else
{
butt.form.submit();
}
}
}






function image_change()
{
document.picture.pic_change.value=1;
document.picture.action.value="add";
document.picture.submit();
}

function size_enable(check_box)
{

temp=check_box.checked;
if (temp)
{
with (check_box.form)
{
pictureWidth.disabled=true;
pictureHeight.disabled=true;
}
} else
{
with (check_box.form)
{
pictureWidth.disabled=false;
pictureHeight.disabled=false;


}
}


}

function configure_another_enable(check_box)
{

temp=check_box.checked;
if (temp)
{
with (check_box.form)
{
configure_another.disabled=false;
}
} else 
{
with (check_box.form)
{
configure_another.disabled=true;
}
}
}
function check_rank()
	{
	rank_flag=1;
	frm=document.configure_order_update;
	
	tiein_count = frm.tiein_count.value;
	elem_count=frm.elements.length
	for(i=0;i<elem_count;i++)
		{
		if(frm.elements[i].type == 'text')
			{
			rank_val = frm.elements[i].value;
			if(rank_val == '')
				{
				alert('Please rank all the Painting/Prints');
				frm.elements[i].focus();
				rank_flag = 0;
				return false;
				}
			
				else if(parseInt(rank_val) > parseInt(tiein_count))
					{
						alert('Rank not to exceed ' + tiein_count);
						frm.elements[i].focus();
						rank_flag = 0;
						return false;
					}
				for(j=i+1;j<elem_count;j++)
					{
					if(frm.elements[j].type == 'text' && rank_val == frm.elements[j].value)
						{
							alert('Rank should be unique');
							frm.elements[i].focus();
							rank_flag = 0;
							return false;
						}
					}
			}
		}
// 	for (k=1;k<=tiein_count;k++)
// 		{
// 		matched=false;
// 		for(i=0;i<elem_count;i++)
// 			{
// 			rank_val = frm.elements[i].value;
// 			if (rank_val==k)
// 				{
// 				matched=true;
// 				break;
// 				}
// 			}
// 		if (matched==false)
// 			{
// 			alert('Rank ' + k + ' has not been allocated');
// 			return false;
// 			}
// 		}
	
				
		
	frm.action='gallery.php';	
	frm.submit();
	return false;
	}
	





