$(function(){

  $('ul.mainmenu li').hover(
		function () {
			//show its submenu
			$('ul', this).slideDown(200);

		}, 
		function () {
			//hide its submenu
			$('ul', this).slideUp(200);			
		}
	);
  
  $(".formSubmit").hover( function() {
		$(".IglForm .submit").addClass("but_hover");
			}, function() {
		$(".IglForm .submit").removeClass('but_hover');
	});
  
  $("td .submit .formSubmit").hover( function() {
		$(this).parent().addClass("but_hover");
			}, function() {
		$(this).parent().removeClass('but_hover');
	});

});

function showTab(catid)
{	
	$("#Details"+catid).show("fast");
}

function hideTab(catid)
{	
	$("#Details"+catid).hide("fast");
}

function select_line(line_id)
{
	$(".PlayList li").removeClass('SSelect');
	$(".PlayList #sel_"+line_id).addClass('SSelect');
}
function select_act(line_id)
{
	$("#songList tr").removeClass('SSelect');
	$("#songList #sel_"+line_id).addClass('SSelect');
}



function showListTab(catid)
{	
	
}

function getMouseXY(e) {
if (IE) { // grab the x-y pos.s if browser is IE
tempX = event.clientX + document.body.scrollLeft;
tempY = event.clientY + document.body.scrollTop;
}
else {  // grab the x-y pos.s if browser is NS
tempX = e.pageX;
tempY = e.pageY;
}  
if (tempX < 0){tempX = 0;}
if (tempY < 0){tempY = 0;}  
alert(tempX + tempY);
//document.Show.MouseY.value = tempY;
return true;
}

function hideListTab(catid)
{	
	//$("#Details"+catid).hide("fast");
}

function SearchWith(stext)
{
	$('#search_text').val(stext);
	document.jsearch.submit();
}

function get_tiny_mice_options(fieldatt){
  tinyMCE.init({
	// General options
	
	elements : fieldatt,

	mode : "exact",
	theme : "advanced",
	skin : "o2k7",
	skin_variant : "black",
	plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
	
	// Theme options
	theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,hr,numlist,bullist,justifyleft,justifycenter,justifyright,justifyfull,|,outdent,indent,blockquote,,forecolor,backcolor,",
	theme_advanced_buttons2 : "fontselect,fontsizeselect",
	theme_advanced_buttons3 : "",
	theme_advanced_buttons4 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_statusbar : false,
	theme_advanced_resizing : true,

	// Example content CSS (should be your site CSS)
	content_css : "css/content.css",

	// Drop lists for link/image/media/template dialogs
	template_external_list_url : "lists/template_list.js",
	external_link_list_url : "lists/link_list.js",
	external_image_list_url : "lists/image_list.js",
	media_external_list_url : "lists/media_list.js"
	
  });
}

function get_tiny_mice_simple(fieldatt){
  tinyMCE.init({
	// General options
	
	elements : fieldatt,

	mode : "exact",
	theme : "advanced",
	skin : "o2k7",
	skin_variant : "black",
	plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
	
	// Theme options
	theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,hr,numlist,bullist,justifyleft,justifycenter,justifyright,justifyfull,|,outdent,indent,blockquote,,forecolor,backcolor,",
	theme_advanced_buttons2 : "undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor|,charmap,emotions,iespell,media,advhr,|,fullscreen, ",
	theme_advanced_buttons3 : "",
	theme_advanced_buttons4 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_statusbar_location : "bottom",
	theme_advanced_resizing : true,

	// Example content CSS (should be your site CSS)
	content_css : "css/content.css",

	// Drop lists for link/image/media/template dialogs
	template_external_list_url : "lists/template_list.js",
	external_link_list_url : "lists/link_list.js",
	external_image_list_url : "lists/image_list.js",
	media_external_list_url : "lists/media_list.js"
	
  });
}


function print_page(print_id)
{
	content = $('#'+print_id).html();

	var pwin=window.open('','print_content','width=50,height=50');

	pwin.document.open();
	pwin.document.write('<html><body onload="window.print()">'+content+'</body></html>');
	pwin.document.close();
	
	setTimeout(function(){pwin.close();},1000);
}

function scrolldown(divid)
{	
	$('#'+divid).toggle('slow');
}

function scrolldown1(divid)
{	

	$('.DownDrop').hide('slow');
	if($('#'+divid).is(":visible"))
		$('#'+divid).hide('slow');
	else
		$('#'+divid).show('slow');
}

/* function to share with facebook */
function fbs_click(surl) 
{
		window.open('http://www.facebook.com/sharer.php?u='+surl,'FaceBookShare', 'height=450,width=450');
}

/* function to share with twitter */
function tweet_click(surl) 
{		//surl = 'http://www.blueclickbpo.com/jugdesi/player/39';
		window.open('http://twitter.com/home?status=Currently Listening to '+surl,'TweeterShare', 'height=450,width=450,scrollbars=yes');
}





