function openWin(url,pop_name,prop)
{
	if((typeof url == 'undefined') || url == '')
	{
		alert('Invalid Properties');
		return;
	}
	if((typeof prop == "undefined") || prop == '') prop = 'height=420,width=500,left=0,top=0';
	if((typeof pop_name == "undefined") || pop_name == '') pop_name = 'newwin';

	var new_win = window.open(url, pop_name, prop);
	return new_win;
}

function OpenNewWin(urlText)
{
	win1=window.open(urlText,'dispwin','width=750,height=600,left=0,top=0,toolbar=no,menubar=no,scrollbars=yes,location=no,status=no');
}

/* 
function postpage(status)
This function is used for checking the process of 'preview, add , update ' process in event module
*/
function postpage(status)
{
    if(status == '2')
    {
        document.forms[0].status.value="1";
        document.forms[0].action.value="publish";
    }
    else if(status == '3')
    {
        document.forms[0].status.value="1";
        document.forms[0].action.value="preview";
    }
    else if(status == '4')
    {
        document.forms[0].status.value="";
        document.forms[0].action.value="cancel";
    }  
    else if(status == '5')
    {
        document.forms[0].status.value="1";
        document.forms[0].action.value="back";
    }    
    document.forms[0].submit();
}  

/*
Function postme()
This function used for posting forms in opportinities modules.

*/

function postme(hid_status)
{
    if(hid_status == '2')
    {
        document.forms[0].hid_status.value="1";
        document.forms[0].hid_action.value="preview mode";
    }
    else if(hid_status == '1')
    {
        document.forms[0].hid_status.value="1";
        document.forms[0].hid_action.value="save";
    }
    else if(hid_status == '3')
    {
        document.forms[0].hid_status.value="1";
        document.forms[0].hid_action.value="update";
    }
    else if(hid_status == '4')
    {
        document.forms[0].hid_status.value="4";
        document.forms[0].hid_action.value="back";
    }
    else if(hid_status == '5')
    {
            document.forms[0].hid_status.value="1";
            document.forms[0].hid_action.value="savealumni";
    }
    
    
    document.forms[0].submit();
}
/*
Function search_oppr()
This function used for checking status of search . 
*/

function search_oppr()
{
        document.forms[0].status.value="1";
        document.forms[0].submit();
}
function add_20(txt_name,flag_name)
{
	num_rows = eval('document.forms[0].'+txt_name+'.value');
	num = parseInt(num_rows) + 20;
	eval('document.forms[0].'+txt_name+'.value='+num);
	eval('document.forms[0].'+flag_name+'.value='+num_rows);
	eval('document.forms[0].hid_refresh.value="1"');
	//document.forms[0].hid_refresh.value = "1";
	document.forms[0].submit();
}

function processForm(n)
{
    if(document.forms[0].editor_mode.checked)
    {
    	content = frames ['composeEditor'].document.body.innerText;
    }
    else
    {
    	content = frames ['composeEditor'].document.body.innerHTML;
    }
    
    document.forms[0].txt_content.value = content; 
    
    document.forms[0].hid_status.value = n; 
    document.forms[0].submit();
}




//------------------------------------------------------------------

function getImgSrc(img)
{
	eval('src = document.images[\''+ img +'\'].src');
	//alert(src);

	arr = src.split('/');
	n= arr.length-1;
	return arr[n];
}

var mem_prev, mem_next;
function swap(n, img_name,img_location)
{
	img_prev = 'img_' + (n-1);
	img = 'img_' + n;
	img_next = 'img_' + (n+1);

	eval('document.images[\''+ img +'\'].src = "'+ img_location + img_name +'"');


	prev_img = getImgSrc(img_prev);
	next_img = getImgSrc(img_next);

	if(window.event.type == 'mouseover')
	{
		mem_prev = prev_img;
		mem_next = next_img;

		/* PREVIOUS IMAGE */
		if(prev_img == 'full_dn.jpg') {

			eval('document.images[\''+ img_prev +'\'].src = "'+ img_location +'bottom_up.jpg"');

		} else if(prev_img == 'full_up.jpg') {

			eval('document.images[\''+ img_prev +'\'].src = "'+ img_location +'full_up.jpg"');

		} else if(prev_img == 'top_up.jpg') {

			eval('document.images[\''+ img_prev +'\'].src = "'+ img_location +'full_up.jpg"');

		} else if(prev_img == 'bottom_up.jpg') {

			eval('document.images[\''+ img_prev +'\'].src = "'+ img_location +'bottom_up.jpg"');

		}

		/* NEXT IMAGE */
		if(next_img == 'full_dn.jpg') {

			eval('document.images[\''+ img_next +'\'].src = "'+ img_location +'top_up.jpg"');

		} else if(next_img == 'full_up.jpg') {

			eval('document.images[\''+ img_next +'\'].src = "'+ img_location +'full_up.jpg"');

		} else if(next_img == 'top_up.jpg') {

			eval('document.images[\''+ img_next +'\'].src = "'+ img_location +'top_up.jpg"');

		} else if(next_img == 'bottom_up.jpg') {

			eval('document.images[\''+ img_next +'\'].src = "'+ img_location +'full_up.jpg"');

		}


	} else {

		eval('document.images[\''+ img_prev +'\'].src = "'+ img_location + mem_prev +'"');
		eval('document.images[\''+ img_next +'\'].src = "'+ img_location + mem_next +'"');

	}
}

function swap1(str, n, act, public_page)
{
	img_prev = 'img_' + (n-1);
	img = 'img_' + n;
	img_next = 'img_' + (n+1);

	//alert(img_prev + "\n" + img + "\n" + img_next);

	if(public_page == 1)
	{
	eval('document.images[\''+ img_prev +'\'].src = "./cms/img/buttons/lft_'+ act +'.jpg"');
	eval('document.images[\''+ img +'\'].src = "./cms/img/buttons/'+ str +'_'+ act +'.jpg"');
	eval('document.images[\''+ img_next +'\'].src = "./cms/img/buttons/rht_'+ act +'.jpg"');
	}
	else
	{
	eval('document.images[\''+ img_prev +'\'].src = "../img/buttons/lft_'+ act +'.jpg"');
	eval('document.images[\''+ img +'\'].src = "../img/buttons/'+ str +'_'+ act +'.jpg"');
	eval('document.images[\''+ img_next +'\'].src = "../img/buttons/rht_'+ act +'.jpg"');	
	}
}

function sp_effect_on(str, n)
{
	pageheader.innerText = str;
	sp_fade(100,50,n);
}

function sp_effect_off(str, n)
{
	pageheader.innerText = str;
	sp_fade(50,100,n);
}

function sp_fade(i,j,n)
{

	for(x=1;x<=5;x++)
	{
		eval('obj = document.getElementById(\'pic'+ x +'\')');
		if(n != x)
		{
			obj.filters.alpha.opacity=j;
		}
	}

	/*
	for(x=1;x<=5;x++)
	{
		eval('obj = document.getElementById(\'pic'+ x +'\')');
		if(n != x)
		{
			obj.filters.alpha.opacity=i;
		}
	}

	if (i>j)
	{
		i-=10;
		setTimeout("sp_fade("+i+","+j+",'"+n+"')",0);
	}
	else if(i<j)
	{
		i+=10;
		setTimeout("sp_fade("+i+","+j+",'"+n+"')",0);
	}
	*/	
}