/*--------------------------------------------------------------------------*
 *  
 *  showPop.js
 *		@require   jquery
 *	function
 *  	showPop(class, top, left)
 *		closePop
 *--------------------------------------------------------------------------*/


jQuery.noConflict();


var xml = '../../shared/js/iconpopup.xml';
var udata = '';
var arclass = '';


jQuery(function(){
	udata = jQuery.ajax({url: xml+'?time='+new Date().getTime(), async:false}).responseXML;
	//jQuery.get(xml, null, function(d, s){
	//	udata = d;
	//}, 'xml');
});

function showPop(popup, bottom, left){
	
	var id = popup;
	//data get
	if(popup.match(/^(cs)[0-9]+/)){
		id = 'cs';
	}else if(popup.match(/^(bs)[0-9]+/)){
		id = 'bs';
	}
	
	var icon = jQuery('icon#'+popup+' description', udata);
	
	
	var ttldata = jQuery("#"+id+" title", udata).text();
	
	var txtdata = jQuery('#'+id+' description', udata).text();
	
	//insert data
	jQuery('#icn_pop p.ttl').html(ttldata);
	jQuery('#icn_pop p.txt').html(txtdata);
	
	
	
	jQuery('#icn_pop p.ttl').addClass(popup);
	arclass = popup;
	
	//set position
	jQuery('#icn_pop').css('bottom', bottom+'px');
	jQuery('#icn_pop').css('left',left+'px');
	
	//show
	jQuery('#icn_pop').show();
	
	//for ie6 select z-index
	if(typeof document.body.style.maxHeight == "undefined"){
		jQuery('#iframe').css('bottom', (bottom+24)+'px');
		jQuery('#iframe').css('left',left+'px');
		jQuery('#iframe').show();
	}
	
}


function closePop(){
	jQuery('#icn_pop p.ttl').removeClass(arclass);
	jQuery('#icn_pop').hide();
	
	//for ie6 select z-index
	if(typeof document.body.style.maxHeight == "undefined"){
		jQuery('#iframe').hide();
	}
}


